Answer Posted / 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 |
Post New Answer View All Answers
What is the displayafter property in updateprogress control?
Can we create a multiple user simultaneously ?
What is a session in asp.net?
What is authorization in asp.net?
How does session id work?
benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks
How can we apply themes to an asp.net application?
What are custom user controls in asp.net?
How can we communicate with each server in N-tier Architecture? and what are the methods?
Why do we use asp.net?
What is meant by server side scripting?
What is windows active directory authentication?
What is the difference between session.abandon() vs clear()?
Which control has default post back is enabled(true)?
What is the appSettings Section in the web.config file?