Reputation: 8740
I need the Html will be something like:
<form onsubmit="return manipulateForm()">
...
</form>
I'm generating it with
HtmlTextWriterAttribute key;
string value;
using (HtmlTextWriter writer = new HtmlTextWriter(new System.IO.StringWriter(innerBuffer)))
{
writer.AddAttribute(key, value);
}
The problem is that the HtmlTextWriterAttribute
Enum does not have a definition for OnSubmit, hot do i get passed it?
Upvotes: 0
Views: 91
Reputation: 8740
Just saw that the class of HtmlTextWriter
has override function for AddAttribute
public virtual void AddAttribute(string name, string value);
So the solution will be like:
using (HtmlTextWriter writer = new HtmlTextWriter(new System.IO.StringWriter(innerBuffer)))
{
writer.AddAttribute("onsubmit", "return manipulateForm()");
}
Upvotes: 1