ASP and CSS - Not meant to be???

admin

Administrator
Staff member
This is driving me insane, I think I might just throw my computer out the window...

I create a text box, and as soon as I type ANYTHING in the CssClass property a huge panel appears around my box, which, when I try and shrink it, gets BIGGER!!!!!

Are ASP and CSS just not meant to be?
If not how else can I get my HTML code looking a little less rubbish (ie font tags everywhere) :mad: ?What is the contents of the CSS class you are you using? Have you had a look at the HTML that is generated?

CSS works with the browser. ASP(.NET) only executes from the server.

Regards.ASP.NET and CSS work perfectly together. In fact, you can manage your CSS in the code-behind. Each web server control has a CssClass property that can managed in the code-behind. For example, on a certain event, you can change the CssClass for your web control to suit the behaviour of the event.

Post your CSS and ASPX for the event concerned and I'll check it out.

AJN<asp:textbox id="idtext" runat="server" CssClass="idtext">

.idtext{
POSITION: absolute;
TOP: 85px;
LEFT: 288px;
Width: 32px;
height: 22px;
}

:)PS It's only in the design window where it's not aligned properly, when I run it, it works perfectly.:rolleyes:The details of your problem are vague so I can't help you with that, but I do agree with Ajn and Buntine, CSS and ASP work very well together and extremely well if you are fluent with both technologies.I disagree, I may be new to this but whenever I delete the styles for a particular tag and add them to the stylesheet it runs fine but in design view it messes up.Design view..? I'm guessing your using a WYSIWYG program, which one. If so, its got nothing to do with CSS and ASP cooperating with each other.I'm using visualstudio.net, you're right the blame lies with them. I'm only using it because I have to for work but it's rubbish.Yes, VS.Net 2003 has pathetic html rendering capabilities and their html support is only slightly better. Hopefully VS 2005 will have better. I use VS primarily for coding and Dreamweaver for UI design.there is another way to do this. If you create a new class called

Input#TextField
{
width: 100px;
min-width: 100px;
}

then name your asp:textbox as TextField it will then adapt to that style, as the asp:textbox is finally rendered as an standard html textbox when you view the pages source.

I've not had any issues regarding asp.net and css, and I build all my sites css dependant.

Kind regards

Gav
 
Back
Top