Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How we call java script on Default.aspx.cs page

java script function callme();
help me
Posted

Hi Vinod,

You can call javascript function from server side using following function.

C#
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "ScriptRegistration", "callme();", true);



Please do let me know, if you have any doubt.

Please provide Vote if this would be helpful to you.

Thanks,
Imdadhusen
 
Share this answer
 
If this is the java script function in aspx page

XML
<script type="text/javascript" language="javascript">
                      function checkCheckBoxes() {



ur code here which u want in the function

}
</script>

Then the code in aspx.cs page to call the javascript function is

MIDL
btnsubmit.Attributes.Add("OnClick", "return checkCheckBoxes()");
 
Share this answer
 
You cannot call javascript function from Default.aspx.cs page
 
Share this answer
 
Comments
Hiren solanki 14-Sep-10 8:44am    
Yes, We can

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900