ASP.Net Server Control Client Script -
is possible run 1 off client side script asp.net server control? know can use page.clientscript.registerstartupscript() on normal page doesn't work on server control.
use on onclientclick="javascript_funcname" attribute
sample
<asp:button id="button1" runat="server" text="save & submit" onclick="btnsave_click" onclientclick="return checkfunction"></asp:button> as want run serverside code 1st client side, @ end of server side code add line
clientscript.registerstartupscript(gettype(), "javascript", "javascript:functionname(); ", true); if using updatepanel try this
scriptmanager.registerstartupscript(gettype(), "javascript", "javascript:functionname(); ", true);
Comments
Post a Comment