Click here to Skip to main content
14,300,956 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have two pages send.aspx and receive.asp, one is aspx page and another one is asp page. i just want to pass values to receive.asp page.

Send.aspx page
Response.Redirect("Pay.asp.html?fee=" + lblgetfee.Text.ToString() + "");


Receive.asp page
<tr title="Enter the Price of the product that is offered for sale">
    <td class="fieldName" width="100%"><span class="error">*</span>Sale Amount</td>
    <td  align="left" width="100%"><input name="amount" type="text"/>
      INR</td>
  </tr>


My requirement is to pass that fee value into TextBox(which is in Receive.asp Page).

Is it possible...?
Posted
Comments
Tom Marvolo Riddle 18-Dec-13 2:33am
   
Use session,cookies..
An@nd Rajan10 18-Dec-13 3:59am
   
what about solution 7,you have got solution please add your own solution...
An@nd Rajan10 18-Dec-13 4:02am
   
why? down voting my solution..
Rate this:
Please Sign up or sign in to vote.

Solution 1

   
Comments
Maciej Los 18-Dec-13 2:37am
   
Excellent!
+5!
Rakesh Meel 18-Dec-13 3:11am
   
Thanks....
Rate this:
Please Sign up or sign in to vote.

Solution 2

   
Comments
Maciej Los 18-Dec-13 2:37am
   
Excellent!
+5!
Rate this:
Please Sign up or sign in to vote.

Solution 7

use session..

first page eg: pass name

Session["SessionObjName"]="Suvabrata";

or
Session["SessionObjName"]=TextBox1.Text;


second page, get the session

String str= Session["SessionObjName"].ToString;
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 3

just use session variable,if u enter value in text box ,that time capture value in session in sender page.and retrieve value from session variable in receive page
   
Rate this:
Please Sign up or sign in to vote.

Solution 4

The easiest method is to pass the value by QueryString from Asp.NET page and get that QueryString on the second asp page.
Comments
Venkat Kumar chigulla 18-Dec-13 3:33am
   
I wrote a query string in send.aspx page and could you tell me how to take that Querystring values in receive.asp page, could please tell me the code
   
You have written like

Response.Redirect("Pay.asp.html?fee=" + lblgetfee.Text.ToString() + "");

But it should be...

Response.Redirect("Pay.asp?fee=" + lblgetfee.Text.ToString() + "");

No need to append the HTML.
Venkat Kumar chigulla 18-Dec-13 4:08am
   
Got the error "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable".
   
That means Pay.asp does not in the current directory.
Venkat Kumar chigulla 18-Dec-13 4:09am
   
In aspx page we have page_load event directly but asp doesn't had. how should i write page_load event in classic asp.
Rate this:
Please Sign up or sign in to vote.

Solution 5

You can pass value from one page by using query string or by using Session variable also.
   
Rate this:
Please Sign up or sign in to vote.

Solution 8

you should do like this

in send.aspx==> Did you use send button,if u used send button==> button click event==>
DataView dv = (DataView)SendSqlDataSource.Select(DataSourceSelectArguments.Empty);
if (dv.Count > 0)
{
foreach (DataRowView dr in dv)
{
Session["Fee"]=dr[0].ToString();
}
}


This is using database
Select fee from send table where fee_id=@fee_id;

And then,receive.aspx==>Page_Load==>TextBox.Text=Session["Fee"].ToString();
   
Comments
Venkat Kumar chigulla 18-Dec-13 4:05am
   
it's not receive.aspx page, it an receive.asp page(classic asp)
Rate this:
Please Sign up or sign in to vote.

Solution 9

Hi
use this line in the second page (Receive.aspx).

txtAmount.Text = Request.QueryString["fee"];
   
Rate this:
Please Sign up or sign in to vote.

Solution 10

send.aspx page:
Response.Redirect("Pay.asp.html?fee="+lblgetfee.Text.ToString()+"");

Receive page:
in page_load()event write like this
int feevalue=convert.toint32(request.querrystring[0].tostring());
textbox1.text=feevalue;
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100