Posts

Showing posts with the label call javascript from code behind

how to raise button on click event in aps code behind?

Here is a simple sample I think that does what you want it to do: html xmlns= "http://www.w3.org/1999/xhtml" > script runat= "server" > protected void popbtn_Click(object sender, EventArgs e) { Page.ClientScript.RegisterClientScriptBlock(typeof(string), "Popup", "window.alert(\"" + inputtxtbx.Text + "\");", true); } script > head runat= "server" > title >Page title > head > body > form action= "default.aspx" runat= "server" > asp:TextBox ID= "inputtxtbx" runat= "server" /> asp:Button ID= "popbtn" runat= "server" Text= "Show Popup" OnClick= "popbtn_Click" /> form > body > html >