Page1.aspx
<%@ Page Language="C#" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> </head> <body> <form id="form1" runat="server"> <div> <asp:Button runat="server" ID="btnSave" Text="Save" PostBackUrl="~/Page2.aspx" UseSubmitBehavior="false" /> </div> </form> </body> </html>Page2.aspx
<head id="Head1" runat="server"> <script runat="server"> protected override void OnLoad(EventArgs e) { base.OnLoad(e); string s = this.Request.Form["__EVENTTARGET"]; if (s.Contains("btnSave")) this.Save(); } protected void Save() { } </script> </head> <body> <form id="form1" runat="server"> </form> </body> </html>
No comments:
Post a Comment