Search

just show me the code

Wednesday, June 24, 2009

call javascript from code behind

    8     <asp:UpdatePanel ID="UpdatePanel1" runat="server"
    9         UpdateMode="Conditional" >
   10         <ContentTemplate>
   12             <asp:Button ID="Button1" runat="server" Text="Button"
   13                 onclick="Button1_Click" />
   14         </ContentTemplate>
   15     </asp:UpdatePanel>

.................


   17         protected void Button1_Click(object sender, EventArgs e)
   18         {
   21             string script = "alert('Message')";
   22             ScriptManager.RegisterClientScriptBlock(UpdatePanel1,
   23                 typeof(UpdatePanel), "jscript", script, true);
   25         }
 
thanks to link

No comments:

Post a Comment

Contributors