Screwing up my HTML

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

This is one of those things that is really bugging me.

I have a big form (lots and lots of textboxes). I know it isn't the
greatest design, but thats besides the point....

So when I have a Form in IE6 with the readonly property and the
Disabled attribute:
<FORM NAME="aForm" id="aForm" READONLY disabled="true">

The entire form is made readonly when the person loads it. This is
what I want.

When I do this on my ASPX page the form is rendered as:
<FORM NAME="aForm" id="aForm" readonly="" disabled="disabled">


This does NOT work.
What gives? Is there no way to tell .NET to leave my HTML alone?
 
This is strange since all HTML is interested in is the bare readonly and
disabled attributes without any values as in:

<form id="aForm" disabled runat="server" readonly>

Not sure why ASP.NET adds values, but I'm surprised that they get in the way
and prevent the form from being readonly and the controls disabled.



This is one of those things that is really bugging me.

I have a big form (lots and lots of textboxes). I know it isn't the
greatest design, but thats besides the point....

So when I have a Form in IE6 with the readonly property and the
Disabled attribute:
<FORM NAME="aForm" id="aForm" READONLY disabled="true">

The entire form is made readonly when the person loads it. This is
what I want.

When I do this on my ASPX page the form is rendered as:
<FORM NAME="aForm" id="aForm" readonly="" disabled="disabled">


This does NOT work.
What gives? Is there no way to tell .NET to leave my HTML alone?
 
You can disable HTML correction in VS.NET from Tools->Options->Text
Editor->HTML/XML->Format. Uncheck the two checkboxes under Apply
Automatic Formatting.

Jalil Vaidya
 
Jalil,

It isn't actually the IDE that is making these changes.

The HTML looks fine in Visual Studio, or if I open it in a text editor
it is just fine.

The problem is that when I browse the page, the ASP.NET engine CHANGES
the html that I have before sending it to the browser.

The ASPX page has:
<form id="Form1" method="post" runat="server" READONLY
disabled="true">

When you view that page in a browser, you get:
<form name="Form1" method="post" action="NewsArticleDetail.aspx"
id="Form1" READONLY="" disabled="disabled">




READONLY is not the same as READONLY=""



disabled="true" is not the same as disabled="disabled"



kinda sucks
 
Back
Top