FreeJobAlert.Com

Government Jobs | Results | Admit Cards

Explain the concept of cross page posting

Each web server control has its own properties and events.On firing event of control, webpage will post back to the same page by default.If you want to post one page to another page, you could use cross page posting.

For Example button (or any control that post backs) is clicked and web page is submits the page back to itself which means a return trip. In Cross page posting, on click of a button there would be no return trip.

• Cross-page posting is done at the control level.
• It is handled by changing the postbackurl property of the controls.
• We could get source page information in the taget page using the FindControl

if (Page.PreviousPage != null)
{
TextBox SourceTextBox =
(TextBox)Page.PreviousPage.FindControl("TextBox1");
if (SourceTextBox != null)
{
Label1.Text = SourceTextBox.Text;
}
}

Tags: asp.net interview questions, basic asp.net interview questions

Leave a Comment