Make sure your script is registered with the ScriptManager.
If the user controls have JS inline, it will not run; JavaScript added by setting the innerHTML of an element (which is what UpdatePanel
does) does not run.
As Rick Schott mentions, if the user controls register their script with the ScriptManager
- either by including asp:ScriptReference
s in their ScriptManagerProxy
or by adding it from their codebehind using one of the ScriptManager.Register*
variants - it will run.
Thanks For your Answers , But I had examined This solutions . User Controls Haven't Script Manager , Script Manager Placed in Home.aspx . I use both Page.RegisterClientScriptBlock , Page.RegisterStartupScript , ... But These don't work properly . Java script Codes in UC are in Script tag in top of UC Like Below :
function pageLoad() {
$addHandler($get("<%=Button2.ClientID%>"), 'click', cp);
}
function cp() {
/* Do shomthing ... */
}
//*################ END OF JAVASCRIPT CODES
In above JS Code Button2 is a asp Button placed in UC . I Find A New Thing today : If add defer='defer' in above Script tag it runs like a charm! But this solution is for IE(ONLY) , So this isn't the best solution . What Can i do more ...?