asp:form generates invalid code

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
 
G

George Ter-Saakov

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>
 
V

Vaclav Jedlicka

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
 
G

George Ter-Saakov

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.
 
V

Vaclav Jedlicka

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

John Saunders

Interesting. I haven't met any customers like this. I hope they also request
that the application works...
 
T

Tian Min Huang

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.
 

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,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top