Malin
11-25-2004, 01:46 AM
I have this problem with Visual Studio 2003.
When I add styletags to for example a textbox it is removed and replaced by the corresponding attributes (ex Height="20").
This would not be a problem if is wasnt for the fact that Netscape compatible browsers require STYLE-tags when it comes to for example the width-attribute.
Netscape and co dont understand the visual studio way where textboxes and so on are having width set like this:
<asp:textbox width="20" height="20"></asp:textbox>
Nescape and co requires the following to understand and display width properly:
<asp:textbox style="width:20px;height:20px"></asp:textbox>
The problem is that Visual studio constantly replaces the style tag with its own height and with attributes like my first example. This is really anoying since I have to change this all the time (everytime I have touched the code VS replaces the styletag). The solution is to always use css-classes but this does not always seem like a good solution since it would result in millions of css-classes. I usually havesome css-classesand then I combine them with additional style-tags in the controls. Sometimes all properties are the same among many controls..only the widht differs.. then I really dont want to have diffrent css-classes for all these controls - instead I add the style attribute and set the width for each control and leaves the css-class without the width-attribute.
Is there a way to stop VS from autochanging in my code like this? If I add a styletag I want to have it there for some reason! This "excellent feature" should be possible to turn off..or? Does anybody know?
Malin
Post Edited (Malin) : 11/25/2004 1:49:11 PM GMT
When I add styletags to for example a textbox it is removed and replaced by the corresponding attributes (ex Height="20").
This would not be a problem if is wasnt for the fact that Netscape compatible browsers require STYLE-tags when it comes to for example the width-attribute.
Netscape and co dont understand the visual studio way where textboxes and so on are having width set like this:
<asp:textbox width="20" height="20"></asp:textbox>
Nescape and co requires the following to understand and display width properly:
<asp:textbox style="width:20px;height:20px"></asp:textbox>
The problem is that Visual studio constantly replaces the style tag with its own height and with attributes like my first example. This is really anoying since I have to change this all the time (everytime I have touched the code VS replaces the styletag). The solution is to always use css-classes but this does not always seem like a good solution since it would result in millions of css-classes. I usually havesome css-classesand then I combine them with additional style-tags in the controls. Sometimes all properties are the same among many controls..only the widht differs.. then I really dont want to have diffrent css-classes for all these controls - instead I add the style attribute and set the width for each control and leaves the css-class without the width-attribute.
Is there a way to stop VS from autochanging in my code like this? If I add a styletag I want to have it there for some reason! This "excellent feature" should be possible to turn off..or? Does anybody know?
Malin
Post Edited (Malin) : 11/25/2004 1:49:11 PM GMT