.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

What is cross page posting in asp.net

Posted By :Ashutosh Jha     Posted Date :July 30, 2014    Points :40   Category :ASP.Net 
Whenever, you need to deal with the first webpage's control value to different pages of your application , you can do this with cross page posting. So, cross page posting enables you to post the WebPage and WebPage's control values to another WebPage in your asp.net applications.

There are two ways we can use cross page postsbacks in ASP.NET

Suppose you have some controls like textboxes, labels and one button on your first page -
ID="Button2" runat="server"
Text="Submit Page to secondpage.aspx"
PostBackUrl="~/secondpage.aspx" />

use PostBackUrl and assign the url of second page.
Now on the second page, using PreviousPage property you can receive those values of controls from your first page.

You can also find related Interview Question to What is cross page posting in asp.net  below: 

cross page posting in ASP.NET2.0???

When we have to post data from one page to another in application we used server.transfer method but in this the URL remains the same but in cross page posting there is little different there is normal post back is done but in target page we can access values of server control in the source page.This is quite simple we have to only set the PostBackUrl property of Button,LinkButton or imagebutton which specifies the target page.In target page we can access the PreviousPage property.And we have to use the @PreviousPageType directive.We can access control of PreviousPage by using the findcontrol method.When we set the PostBackURL property ASP.NET framework bind the HTML and Javascript function automatically. (More...)

What is Cross-Page Posting?

Whenever you send a request to the server it sends request to the same page. Cross_page posting means it will send request to the another page. we can achieve. this through postback url property (More...)

Difference between Server.Transfer and Cross Page Posting

In 'Server.Transfer', the URL doesn't change whereas in cross page posting, the form is submitted to a different page, thereby changing the url.
The Server.Transfer method is a server-based operation whereas cross-page postback is a client-based transfer. (More...)

What is Cross Page Posting? How is it done?

By default, ASP.NET submits a form to the same page. In cross-page posting, the form is submitted to a different page. This is done by setting the 'PostBackUrl' property of the button(that causes postback) to the desired page. In the code-behind of the page to which the form has been posted, use the 'FindControl' method of the 'PreviousPage' property to reference the data of the control in the first page. (More...)

You are working on an ASP.NET application. One of the drop down list contans 1 lakh records. The page posting becomes very slow. How to overcome this? You just need the selected index of the dropdownlist on submit.

Use EnableVieState=false. On the dropdown change event, set a hidden field value to the selected index.

Disabling view state helps us in reducing the postback load. (More...)

Explain the life cycle of an ASP .NET page.

Life cycle of ASP.Net Web Form
Page Request >> Start >> Page Init >> Page Load >> Validation >>
PostBack Event Handling >> Page Rendering >> Page Unload
Page Request - When the page is requested ASP.Net determines
whether the page is to be parsed and compiled or a cached verion
of the page is to be sent without running the page.
Start - Page propertied REQUEST and RESPONSE are SET, if the
page is pastback request then the IsPostBack property is SET and
in addition to this UICulture property is also SET.
Page Initilization - In this the UniqueID of each property is SET.
If the request was postback the data is not yet loaded from the
Page Load - If it was a postback request then the data gets loaded
in the control from the ViewState and control property are set.
Validation - If any control validation present, they are performed
and IsValid property is SET for each control.
PostBack Event Handling - If it was a postback request then any
event handlers are called.
Page Rendering - Before this the viewstate is saved from the page
and RENDER method of each page is called.
Page Unload - Page is fully rendered and sent to the client(Browser)
and is discarded. Page property RESPONSE and REQUEST are unloaded. (More...)

What is a master page ?

1) A master page provides a framework in which the content of each page on a web site is presented. Master pages make it easy to create pages that have a consistent look.

2) The pages that provide the content that's displayed in a master page are called content pages .

3) The content of each content page is displayed in the master page's content placeholder (More...)

How do you turn off cookies for one page in your site?

Use the Cookie. Discard Property which Gets or sets the discard flag set by the server. When
true, this property instructs the client application
not to save the Cookie on the users hard disk when a session ends.
it can be turned off by mentioning cookie state= false in web.config file (More...)

How do you turn off cookies for one page in your site?

By setting the Cookie. Discard property false. (More...)

How do you turn off your cookies for one page on your site?

It can be Turn Off by mentioning Cookies state=false in Web.Config file (More...)

What are the differences between web part page gallery, site gallery,Virtual server gallery and online gallery in SharePoint?

Web Part Page Gallery in SharePoint is the default gallery provided by Microsoft that comes installed with SharePoint. Site Gallery is specific to one sharepoint website site. Virtual Server gallery is specific to that virtual server and online gallery is available for download web parts from MSDN. (More...)

Which is the first event in page life-cycle Event?

Page_PreInit is the First event that will be executed on the page. (More...)

When during the page processing cycle is ViewState available?

After the Init() and before the Page_Load(), or OnLoad() for a control. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend