Cross Page posting in asp.net

Submitted by planetsourcecode on
Cross Page posting in asp.net We can cross post the data in asp.net from one page to another page.Cross Page posting feature allows a page to cross post to another page which in turn allows you to access all data in posted source page. By simply setting PostbackUrl property, we specify the destination page to which present page should post when post back occurs on present page. Different method for posting data are as follows: There are several methods to post data from one page to another page depending on your needs. If you need to exchange simple insensitive data, try with existing techniques. So, let us revisit those different techniques which allow exchanging data from one page to another. 1). Response.Redirect method we can use this mehod to alloow user browser to move from one page to another page. like if a user is on page(sourcepage.aspx) and click on buttn on it then it will move from that page to the desitination page,Now the Client's address bar shows DestinationPage.aspx. 2). Session Variables We can use session variable to store page information and use it across different pages for entire user session. However, this involves of consumption of costly server resources. 3). Server.Transfer Method we have server doing the page transfer. In Server.Transfer, Http Context is preserved when moving from one page to another which means we can access the source page's items collection in target page. The drawback of using this method is that the browser does not know that a different page was returned to it. It still displays the previous source page's URL in the address bar. This can confuse the user. Transfer is not recommended since the operations typically flow through several different pages. Happy Coding About the author: Planet Source Code is a place for all developer providing free source codes, articles, complete projects,complete application in PHP, C/C++, Javascript, Visual Basic, Cobol, Pascal, ASP/VBScript, AJAX, SQL, Perl, Python, Ruby, Mobile Development