By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,579 Members | 1,765 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,579 IT Pros & Developers. It's quick & easy.

Visual Studio 2003 reformats/removes HTML code in Design mode

P: n/a
I have an html table based form that has textboxes embedded in table rows on
it. I wanted to have the textboxes autosize and also have the table rows
autosize. To accomplish this, I added a user-defined function that counts
the number of carriage return/line feeds and sets the textbox's Row property
accordingly. This works to autosize the textbox. Also, I wanted the
containing table row to autosize to show the full textbox. The reason for
this is I'm making the textbox appear as a label (style="OVERFLOW: hidden").
To accomplish, I have the function pass back a string with the number of
pixels represented by the number of rows in the textbox. I assign this
return value to the Height attribute of the row as follows:

<TD vAlign="middle" align="left" colSpan="4" style="HEIGHT:
=GetKeyTermsHeight()" >

This works great! The problem is that the next time I open the form, the
Visual Studio designer opens the form and goes to the Design tab. This
reformats the HTML automatically and removes the style="HEIGHT:
=GetKeyTermsHeight()" code above. No warning! I turned off ALL auto
formatting of HTML/XML in Tools/Options. No help there! What can be done to
prevent this? Currently, I'm saving the <TD> definition to the Code behind
window as a comment and repasting it in the HTML view before rebuilding my
solution. It's a big pain though because the project is very large, and I'm
concerned that another developer will unwillingly change and lose this
feature for me. I'd like to add the autosize to my other forms, but doing so
would be a code management nightmare that I can't afford right now. Any
ideas? Please!
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a

I can give you a solutions, however probably that will not work because of
the fact that a aspx page (what is an HTML page) is dependend from the
settings of the user.

That can be such a lot that you cannot manage that from your application.
Think about that from the screen format and all those settings that can be
done in the browser (where you probably have done it now only for the last

To set what you want you need the attributes property

I hope this helps,

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.