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
A Super-hero Sharepoint developer with great design skills Project Description: US: Our start-up company develops a very cool and innovative SharePoint related product with c

Web Application and Web Service For this part of the assignment, you are to develop a web application and web service using technologies and techniques taught in this subject

Question: (a) What is VB.NET 2005 and explain the versions of VB.NET. Name the four different types of applications that new version of VB.NET can create. (b) Using the

What is the use of a .disco file? A client application uses a .disco file to locate or discover the documents that have the description of a Web service. The .disco file having

Develop Skype Recorder Application + Setup + Sourcecode + NICE UI Project Description: i need an application built which will allow user to record skype audio or video calls

In What scenarios you use a DOM parser and SAX parser? 1) If you do not require all the data from the XML file then SAX approach is most preferred than DOM as DOM can quiet mem

i want to know the code for adding new item button in .net forms and delete button in vb.net forms. can any one pls help

What are the different locks in SQL SERVER? Depending on the transaction level there are six types of lock that can be acquired on data :- 1)Intent: The intent lock des

What is Object Relational Designer? The 0/R Designer provides a visual design surface to make LINQ to SQL entity classes and associations (relationships) that are based on obje

ILDASM When it comes to the understanding of the internals nothing can beat ILDASM. ILDASM  converts all the exe or dll into IL code. To run ILDASM you have to go to "C:\Progra