Question

It seems like I can't set the id or name of the form in my masterpage. [it's always "aspnetForm"]

Is there a way to override the uniqueID property of form?

I tried to create a class and inherit from htmlform, but then i can't register it on my mastrepage, [unknown server tag ... ]

im registering it like this

<%@ Register TagPrefix="cf" Namespace="Framework.BaseForm" %>
Was it helpful?

Solution 2

i implemented this and it's working

create a class called 'BaseForm' that inherits from HtmlForm

override the UniqueID property and return the name that you want.

register this in your masterpage using <%@ Register TagPrefix="cf" Namespace="Framework.BaseForm" %>

and replace the

<form></form> tags with <cf:BaseForm></cf:BaseForm>

my problem was that the masterpage couldn't find the code for BaseForm, i had to put it in app_code

OTHER TIPS

Found this, which should answer your questions...

Unfortunately you can't change the ID of an ASP.NET form.

http://forums.asp.net/t/1300826.aspx

and

http://forums.asp.net/p/883974/929349.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top