Cross Page Posting

Basically, cross-page posting means that you are posting form data to another page as opposed to posting form data back to the same page (as is the default in ASP.NET). This can be useful when you want to post data to another page and don't want to incur the overhead of reloading the current page simply to redirect the user to another page.
 
crosspage1.aspx
<asp:Label ID="Label1" runat="server" Text="I want to access by crosspage posting"></asp:Label>
        <asp:Button ID="Button1" runat="server" Text="crosspage" PostBackUrl="~/crosspage2.aspx" />


crosspage2.aspx 
 if (PreviousPage != null && PreviousPage.IsCrossPagePostBack != null)
        {
            Label1.Text = "result of cross page posting : = " + ((Label)PreviousPage.FindControl("Label1")).Text;
        }

Comments

Popular posts from this blog

Executing PowerShell scripts from C#

HOW TO Use the NumericUpDown Control

Exposing Agile Software Development Myths