Skip to content

Instantly share code, notes, and snippets.

@house9
Created August 19, 2010 19:06
Show Gist options
  • Save house9/538625 to your computer and use it in GitHub Desktop.
Save house9/538625 to your computer and use it in GitHub Desktop.
public partial class JavaScriptConfirm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// wire the client side onclick to TestButton4
this.TestButton4.Attributes.Add("onclick", "return AreYouSure();");
if(Page.IsPostBack)
{
Response.Write
(
String.Format("Page_Load, IsPostBack: {0}<hr>", DateTime.Now.ToLongTimeString())
);
}
}
// the server side 'event' kicked off when asp:button is clicked
protected void InvokeServerSideMethod(object sender, EventArgs e)
{
Response.Write
(
String.Format("InvokeServerSideMethod, E: {0}<hr>", DateTime.Now.ToLongTimeString())
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment