asp:form generates invalid code

  • Thread starter Thread starter Vaclav Jedlicka
  • Start date Start date
V

Vaclav Jedlicka

Hi all

The code generated by the server side control asp:form generates invalid
code. The HTML tag FORM always contains attribute "name".

When I validate the page with the online validator
(http://www.htmlhelp.com/tools/validator/direct.html) it says that:

<form name="browse" method="post" action="browse_employees.a ...
^Error: there is no attribute NAME for this element (in this HTML
version)



How can I prevent asp:form from generating this attribute?



Thanks in advance

Vaclav Jedlicka
 
Just validated the following HTML

---------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title></title>

</head>
<body>
<form name="Asd" action="asd"></form>

</body>
</html>
 
Thanks

You use HTML 4.01, I used 4.0, that is why I had the problem. I can fix my
problem by using version 4.01.

May I have another question? I am havening this problem with the validator
(even with HTML 4.01). The SCRIPT tag is generated by ASP.NET

<script language="javascript">
^Error: required attribute TYPE not specified
 
Why would you care about all that?
There are about 95% of IE out there and a handful of other browsers.
I do knot know even one browser that requires to have TYPE.



George.
 
Because some customers request valid HTML code.

George Ter-Saakov said:
Why would you care about all that?
There are about 95% of IE out there and a handful of other browsers.
I do knot know even one browser that requires to have TYPE.



George.
 
Interesting. I haven't met any customers like this. I hope they also request
that the application works...
 
Hello Vaclav,

I just did a quick search and found that it is a known issue. It seems
you're out of luck. The RenderPostBackScript method implemented in the Page
class is declared as
private and it has the "<script language="javascript"> string hard-coded
into it. Also there are other methods that will output the script tag this
way so as a quick and workaround you could override the rendering of the
Page and do a search & replace operation (<script language="javascript">
----> <script type="text/javascript">) before rendering the contents.

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
 
Back
Top