I have a form as
When accessing in C# code-behind via
You can use the Control Adapters of asp.net.
Here is a working example:
public class RewriteFormHtmlTextWriter : HtmlTextWriter
{
public RewriteFormHtmlTextWriter(HtmlTextWriter writer)
: base(writer)
{
this.InnerWriter = writer.InnerWriter;
}
public RewriteFormHtmlTextWriter(System.IO.TextWriter writer)
: base(writer)
{
base.InnerWriter = writer;
}
public override void WriteAttribute(string name, string value, bool fEncode)
{
if (name == "action")
{
value = "Change here your value"
}
base.WriteAttribute(name, value, fEncode);
}
}
With the above code, and a declare on the App_Browsers
with a file called Form.browser
you can change the form. Of course this code called in every form render.
Relative : http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx