Screwing up my HTML

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?
 
O

Oliver

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?
 
J

Jalil Vaidya

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
 
C

Chris

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top