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
Do session use cookies in asp net?
Why should i prefer JSP over asp.net or any other web development language..??
What is the difference between the asp and asp.net?
What are sql notifications and sql invalidations?
What is the difference between adding reference in solution explorer and adding references by using ?
explain code with datachaching with example
What is x xss protection?
How do I publish my asp.net application to my isp's web server?
What is autopost?
Describe a Windows Service and its lifecycle ?
What is the use of web.config file?
What is difference between asp.net and asp.net mvc? : Asp.Net MVC
How you can stop the validation of ASP.NET controls from client side?
What is master page in dtp?
What is %20 in a url?