This is one approach that I really do not recommend, but it will do what you want. It uses javascript to change the URL (e.g. default2.aspx), the form is submitted to use the form's action attribute, and then the form is submitted
protected void btnClick(object sender, EventArgs e) { string script = "<script> document.forms[0].action='default2.aspx'; document.forms[0].submit(); </script>"; ClientScript.RegisterClientScriptBlock(this.GetType(), "postform", script); }
The second page should have EnableViewStateMac="false"
<%@ Page Language="C#" EnableViewStateMac="false" AutoEventWireup="true" CodeBehind="default2.aspx.cs" Inherits="CodeGen.default2" %>
Caution: Disable MAC generation by setting enableViewStateMac = false on the page or web.config. This is not recommended as the MAC helps prevent unauthorized use of your data in the view. But if faking data in the form of representations is not a concern (perhaps this may not be for some applications where there is no risk of fraud or security breaches), you can disable it. More details
source share