dodgerfan
asked on
ASP.Net passing values between forms
I'm having a problem passing a value between forms in ASP.Net (C# code behind). On my first page, I select a record from a grid and a new page opens up that displays just the selected record. This TravelForm opens correctly, and the data is divided up into different sections. I have a button after each section to edit the data. So section one has an Edit button. The onclick event uses javascript to open another form (TravelEdit) as a popup to allow editing. The id of the record is in the query string of the TravelForm page (/TravelForm.aspx?id=1001) . In the databind event on the TravelEdit button, I try to call the record with that ID. The query passed to the code is:
string trData = "select * from tablename where trip_id = " + Request["id"];
That is not working. I get an incorrect syntax error near '='. When I debug, I can see that no value is being passed. I've also tried:
string trData = "select * from tablename where trip_id = '" + Request.QuesrtyString["id" ] + "'";
Any idea what I'm doing wrong here?
string trData = "select * from tablename where trip_id = " + Request["id"];
That is not working. I get an incorrect syntax error near '='. When I debug, I can see that no value is being passed. I've also tried:
string trData = "select * from tablename where trip_id = '" + Request.QuesrtyString["id"
Any idea what I'm doing wrong here?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I got this working. These suggestions helped me get it going.
ASKER