Possible Duplicate:
How to call javascript function from c#
Is there a way to call a javascript function from a button click in code behind in C#? So basically I have a registration form and when you click the button, then all the data is processed in the code behind and the form is submitted. But I need to execute some javascript and I need it to be executed on the button click and in code behind.
so something like:
protected void btnDoRegister_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
C# code is here doing form processing
// Now I need to Execute javascript here.
}
Is this possible and how would I go about doing it, if it is?
Thanks!
<input type="submit" onclick="return validateForm();" />which will only pass to the server ifvalidateFormreturns true.