How cross page posting is done in Asp.net 2.0?

Answers were Sorted based on User's Feedback



How cross page posting is done in Asp.net 2.0?..

Answer / abhishek kumar

cros page posting is page to page data transfer machanism
like query string.

you can do it two ways :

1. using <%@ PreviousPageType VirtualPath="~/
SourcePage.aspx" %> directive :- If the target page
contains a PreviousPageType directive that points to the
source page, you can access the source page's CurrentCity
property using code such as the following.

Label1.Text = PreviousPage.CurrentCity;

2. Using PostBackUrl and PreviousPage property :-

In source page specify PostBAckUrl property to control
which you use to generate postback like,

<asp:Button
ID="Button1"
PostBackUrl="~/TargetPage.aspx"
runat="server"
Text="Submit" />

In TargetPage.aspx :-

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

Is This Answer Correct ?    13 Yes 1 No

How cross page posting is done in Asp.net 2.0?..

Answer / xyz

yes

Is This Answer Correct ?    0 Yes 5 No

How cross page posting is done in Asp.net 2.0?..

Answer / yogesh sharma

Like IsPostBack property there is IsCrossPostBack property
that sets to true if page is redirected from a page.

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More ASP.NET Interview Questions

How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them ?

1 Answers   MMTS,


if i have a web page, and after the postback i dont to maintain the viewstate. How can we maintain in web application?

4 Answers   CGI,


what is narmalization

4 Answers   Wipro,


How do I open an ashx file?

0 Answers  


suppose we have two object;obj1 and obj2 can we assign obj2 to one1; and if yes; then after assigning suppose we delete obj2 then obj1 will retain obj2 value or not.

3 Answers  






What are httphandlers and httpmodules and difference between them?

0 Answers  


How .net CLR works with n-tier application

4 Answers   HCL, Hughes,


How To Send Value one page to Another Page On MasterMenu Click ? please Tell Me!

3 Answers   Accenture,


what is the difference between console.writeline &console.output.writeline?

2 Answers  


how to elimainte the similar data from the different tables

0 Answers  


Explain server-side scripting?

0 Answers  


Explain current thinking around IClonable.

1 Answers   Infosys, Wipro,


Categories