0

How to call the below JavaScript function:

function mySubmit() {
    document.getElementById('frm').submit();
}

inside asp.net code behind function:

<%
if(!isPostBack)
{
    ----I want to call the above JavaScript code here---      
}
%>

1 Answer 1

1

You don't - javascript is executed on the client.

What you can do is register the script on the postback - which would execute as soon as the page is loaded on the client.

To do this you would use ScriptManager.RegisterStartupScript().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.