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 to store a dataset in a viewstate?

3 Answers   IBM,


How will you do windows authentication and what is the namespace? If a user is logged under integrated windows authentication mode, but he is still not able to logon, what might be the possible cause for this? In ASP.Net application how do you find the name of the logged in person under windows authentication?

0 Answers  


Define cookie.

0 Answers  


How could you modify xaml content from javascript?

0 Answers  


if i have placed the button control with the OnClick event like <asp:Button ID="mybutton" runat="server" Text="Insert" onclick="mybutton_Click" /> and some other controls(buttons, textboxes) in .aspx page. When i run the page, the button displays in the page source of the browser like <input type="submit" name="mybutton" value="Insert" id="mybutton" /> here, it does not display the onclick event, then how the page calls the button click on the server side, how the server side identify which button cause the submit, and how this page moves to the server side.

1 Answers  






What is .net framework and what are the main components of it?

0 Answers  


what is state management?

2 Answers  


Explain the difference between panel and groupbox classes using .net?

0 Answers  


what is a virtual class?

1 Answers   Patni,


What is difference between URL and URI?

0 Answers   MCN Solutions,


different architectures of asp.net?

1 Answers  


How do you handle unhandled exceptions in ASP.NET?.

3 Answers  


Categories