Asked By Reena Jain on 04-Oct-10 03:22 AM
Hi jeethu

Hi you can pass the value for page to another page use following


Passing Values Using Cross Page Postback

Using cross page postback means posting the source page to a different aspx page. By default, all aspx pages will post to itself. You can understand this when you see the action attribute of form tag which will have the value as the same page name. This means, clicking a submit button on the page will post to the same page on the server.  Coming to our subject, you can use this technique to post the values in source page to a destination page using cross page postback.


There are multiple ways of implementing it. Some are below,

1.    You can set the action attribute of form tag as Destination page,

<form id="form1" runat="server" action="Destination.aspx">


2.    You can use jquery or javascript to chaneg action attibute of form tag to destination page.

<script src="../scripts/jquery-1.4.1.min.js" type="text/javascript"></script>

   <script type="text/javascript">

     $(document).submit(function() {

     $("form").attr("action", "Destination.aspx");



here is some more link for help

Asked By Sagar P on 04-Oct-10 03:25 AM
If you are using Cross Page posting then you can easily get all controls values to other page by using PreviousPage like; if you have page where 2 text boxes and one button which will use cross page posting to redirect to next page;

<form id="form1" runat="server">
  <h2> This page will cross post to another page by setting PostbackUrl property of submit button.</h2>
    <asp:Label ID="lblName" runat="server" Text="LoginName" style="left: 76px; position: relative; top: 20px"></asp:Label><br />
    &nbsp;<asp:TextBox ID="txtPassword" runat="server" style="z-index: 100; left: 160px; position: relative; top: 34px"></asp:TextBox>
    <asp:TextBox ID="txtName" runat="server"></asp:TextBox><br />
    <asp:Button ID="btnSubmit" runat="server" Text="Submit"      
    PostBackUrl="DestinationPage.aspx" style="left: 208px; position: relative; top: 54px" />
    <br />
   <asp:Label ID="lblPassword" runat="server" Text="Password" style="left: 90px; position: relative; top: -12px" Height="4px" Width="43px"></asp:Label></div>

So on destination page you can access the values of these text boxes like;

Label1.Text = "Name:" + CType(PreviousPage.FindControl("txtName"), TextBox).Text
Label2.Text = "Password:" + CType(PreviousPage.FindControl("txtPassword"), TextBox).Text

Check out this link to know more abt state management in case of Cross page posting;
Asked By Jatin Prajapati on 04-Oct-10 03:33 AM
Hi Jeethu.

I suppose that you have used the Button's post BackUrl for Cross-page postback or set the forms action to your destination page.

So on the destination page you can retrieve your values from previous page using following code snippet.

Suppose on your Page1.aspx you have a text box named txtName. When you do cross-page postback to Page2.aspx you can use string name = Request.Form["txtName"];  This will give you the value of txtName textbox on your Page1.aspx. Same way you can get other text box values.

Asked By Lalit M on 04-Oct-10 03:39 AM
You can get information from below link will help.
Asked By Sagar P on 04-Oct-10 05:30 AM
CType is used just to convert the control into TextBox... its like out TypeCasting ....
So the statement like this CType(PreviousPage.FindControl("txtName"), TextBox) will convert control to TextBox so that we can use Text property to get the text of text box....
It a sytax for type casting.....