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

What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState ?

1 Answers  


When we are requesting a new URL through Response.Redirect() the new page wil open on the new browser window or it wil open in the same window? If we use Server.Transfer() what wil happen?

1 Answers  


In cache where dats is stored and how(file or object?)

2 Answers  


What is the use of session?

0 Answers  


Rate yourself in .net and sql database?

1 Answers   BrickRed, Infosys, Satyam, SP Software,






What is early binding and Late binding. Difference which is better ?

2 Answers   DELL,


Explain exception handling in .net.

0 Answers  


What is the difference between stored procedure vs function?

0 Answers  


What is the difference between client-side and server-side validations in ASP.NET?

0 Answers   Sans Pareil IT Services,


5. What three Specific Job Positions do you target from Swatz Oils GROUP U.K?

0 Answers   Swatz Oils,


if we establish the cinnection with connection string tag in web.config file,can i go for encrypt and decrypt with that?

1 Answers  


which is the new version of IIS SERVER

1 Answers  


Categories