Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
2.50/5 (4 votes)
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
C#
Response.Redirect("Pay.asp.html?fee=" + lblgetfee.Text.ToString() + "");


Receive.asp page
CSS
<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
Updated 10-Oct-19 2:04am
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..

 
Share this answer
 
Comments
Maciej Los 18-Dec-13 2:37am    
Excellent!
+5!
[no name] 18-Dec-13 3:11am    
Thanks....
 
Share this answer
 
Comments
Maciej Los 18-Dec-13 2:37am    
Excellent!
+5!
use session..

first page eg: pass name

C#
Session["SessionObjName"]="Suvabrata";

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


second page, get the session

C#
String str= Session["SessionObjName"].ToString;
 
Share this answer
 
v2
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
 
Share this answer
 
The easiest method is to pass the value by QueryString from Asp.NET page and get that QueryString on the second asp page.
 
Share this answer
 
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.
You can pass value from one page by using query string or by using Session variable also.
 
Share this answer
 
 
Share this answer
 
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();
 
Share this answer
 
Comments
Venkat Kumar chigulla 18-Dec-13 4:05am    
it's not receive.aspx page, it an receive.asp page(classic asp)
Hi
use this line in the second page (Receive.aspx).

C#
txtAmount.Text = Request.QueryString["fee"];
 
Share this answer
 
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;
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900