Cross page posting, DOT NET Programming

What is cross page posting?

By default, the button controls in the ASP.NET pages post back to the similar page that contains button, where you can write an event handler for the post. In most of the cases this is the desired behavior, but occasionally you will also want to be able to post to other page in your application. The Server. Transfer process can be used to move b/w pages, however the URL doesn't change. In spite, the cross page posting feature in ASP.NET 2.0 allows you to fire a normal post back to a different page in the application. In the target page, you can access the values of server controls in the source page that initiated the post back.

To use the cross page posting, you can set the PostBackUrl property of a LinkButton,  Button or ImageButton control, which specifies the target page. In the target page, you can then access the PreviousPage property to retrieve the values from the source page. By default, the PreviousPage property is of type Page, so you must access controls by using the Find Control Process. You can also enable strongly-typed access to the source page by setting the @PreviousPageType directive in the target page to the virtual path or Type name of source page.

Here is a step-by-step guide for implementing the cross-page post back using controls that implement the IButtonControl interface.

1)    Create a Web Form and insert a Button control on it using the VS .NET designer.

2)     Set the button's PostBackUrl property to the Web Form you want to post back. For instance in this case it is "nextpage.aspx"

When the PostBackUrl property of the IButtonControl is set, the ASP.NET framework binds the corresponding HTML element to new JavaScript function named WebForm_DoPostBackWithOptions. The corresponding HTML rendered by the ASP.NET 2.0 will look like this:

Posted Date: 9/22/2012 1:12:47 AM | Location : United States

Related Discussions:- Cross page posting, Assignment Help, Ask Question on Cross page posting, Get Answer, Expert's Help, Cross page posting Discussions

Write discussion on Cross page posting
Your posts are moderated
Related Questions
How can we connect to Microsoft Access, Foxpro , Oracle etc ? The Microsoft provides System.Data.OleDb namespace to communicate with the databases such as Oracle, scess  etc. I

What are the steps to create a windows service in VB.NET ? The Windows Services are long-running executable applications that run in its own Windows session, which then has the

Generate Function to Create Signed_Body for Instagram Project Description: I want the exact Signed_Body for Instagram The only difference is that I want the most recent ve

How do I force the Dispose method to be called automatically, as clients can forget to call Dispose method? To Call the Dispose method in the Finalize method and in the Dispose

concept of strong names Strong name is similar to GUID(It is supposed to be unique in space and time) in the COM components.Strong Name is only needed when we need to deploy as

What is the namespace in which .NET have the data functionality classes? : This namespace contains the basic objects used for accessing &  storing relational d

What is the difference between Server.Transfer and response.Redirect? The difference  between the Server.Transfer and the response.Redirect them are as follows:- 1)Response.

What are the steps involved to fill a dataset ? The sample code is shown below: Private Sub LoadData() Dim strConnectionString As String strConnectionString = AppSetti

Find out the Factorial - C# Program I've been trying so many codes for this but those codes didn't work well. Please write the code for find out the factorial of an integer nu

PhotoHandler add-on to display file names Project Description: I want a website with a photo gallery using PhotoHandler. I need the code added/ modified to display the image