Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to call a javascript function in content page from aspx page itself
C#
<asp:Content ID="head" ContentPlaceHolderID="headcontent" Runat="Server">

C#
function func1()
{
alert('the code i want to bind to dropdownlist ');
}
window.onload=func1
function func2()
{
alert('hai');
}
this is not working 
even this is also not working
window.onload=fun_onload()
{
func1()
}
Posted
Updated 20-Nov-11 22:01pm
v2
Comments
demouser743 21-Nov-11 4:02am    
I didn't get your question exactly. Can you explain more what you are trying to achieve..

Formatted your question in a better way by including the script in code lines

1 solution

How about calling it on Page_Load event in code-behind. Have a look at below link for an example.

http://www.dotnetcurry.com/ShowArticle.aspx?ID=274
 
Share this answer
 

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