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 cross page posting? How is it done?
can we remote debug applications with the remote debugger installed with vs.net 2002, with vs.net 2003?
What is difference between ispostback and autopostback in asp net?
What is OSI layer? Explain different layers.
Why session is used in asp.net?
Where are session variables stored?
What is the syntax for datagrid and specifying columns?
Difference between web user control and web custom control?
Which authentication uses a combination of windows and iis authentication?
How do you identify that the page is postback?
What do you understand from custom control?
What is the difference between a default skin and a named skin?
What is a page life cycle? What are the events in a page life cycle?
How do cookies work? Give an example of their abuse.
Can one dll file contains the compiled code of more than one .net language?