I show a page in a jQuery dialog box. The user fills in the fields and submits the form.
In the function I need to call e.preventDefault(). In the underlying code I used the RegisterStartupScript method on the submit button. I know how to do it by passing parameters:
System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page),
"Script", "OrderForm('Item.aspx?OrderNum=" & _ID & "');", True)
How can I pass an event object in registerStartupScript?
I want a function like this:
function OrderForm(e, number) {
e.preventDefault();
//do something using number;
}
<btn>. Did you mean for that to be a class or ID?OrderForm()fromRegisterClientScriptBlock(), there is no event to pass because you are calling the method directly. I mean in your code there is no event to handle. See the example from msdn; in that example is possible to pass an event because the user needs to click the button.