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
Why session management is required?
In which event are the controls fully loaded?
How would you create a permanent cookie?
How ASP.NET page works?
What is the use of execute non query in asp.net?
Explain exception filters?
Can I recieve both html markup for page and code in the asp.net web page's source code portion in the web browser?
Which library is used by the testers and developers to develop automated tests and create testing tools?
Explain the updatepanel?
What is the current version of asp.net?
Which method is used to perform all validation at the page level?
In Code-Behind class which kind of code (server or client) is found ?
What is the maximum timeout we can set for Cookies?
How do http sessions work?
Where are session variables stored?