I've just migrated our web application to ASP.Net 2.0 and one of the things it is doing is removing the ID attribute from all the <form> tags.
Our JavaScript relies heavily on the ID of the form tags and was wondering why this is happening and if there is any way to keep the form ID names intact.
Thanks,
Allen
There are 10 types of people in this world: those that understand binary and those that don't.
Allen, I assume you are converting to vs2005 website projects. The ids from from tag is removed if the ID matches to the class name. If we did not remove, it would cause compilation error since field declaration cannot be same as class name.
xenoak47
Member
170 Points
36 Posts
Conversion removes ID attribute from <form> tags on all pages.
Apr 12, 2006 12:34 AM|LINK
Our JavaScript relies heavily on the ID of the form tags and was wondering why this is happening and if there is any way to keep the form ID names intact.
Thanks,
Allen
Baiju
Participant
990 Points
198 Posts
Microsoft
Re: Conversion removes ID attribute from <form> tags on all pages.
Apr 12, 2006 05:48 PM|LINK
Allen, I assume you are converting to vs2005 website projects. The ids from from tag is removed if the ID matches to the class name. If we did not remove, it would cause compilation error since field declaration cannot be same as class name.
Eg;
partial class Form : Page {
HtmlForm Form; <<== will cause error.
}
As a work around
1. You can rename ID and use it.
2. You can use new Web Application Projects.(http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx)
Baiju