Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass data to other page

Status
Not open for further replies.

pikasat

Technical User
Jun 7, 2002
12
HR
I have page with table in which are results from db, and two dates entered by user on previous page (used in query to search db). There can more results, I resolve this using repat region behaviour in DW (maybe should be in that forum ?). In each row there is link to next page using ID connected to data from DB.

<a href="detail.asp?ID=<%=(Recordset2.Fields.Item("ID").Value)%>"><img src="images/link.jpg" /></a>

And by this all data from database is display on that next page(as you see, called "deatil.asp"). But how to display this two dates which are not in database ? (inputed in two textfields) I need to transfer them somhow to that next page because it's update page.
 
When the page loads place the date in a variable then when you do <a href="detail.asp?ID=<%=(Recordset2.Fields.Item("ID").Value)%>"><img src="images/link.jpg" /></a>
Append the dates to the end of your href. detail.asp?ID=<%=(Recordset2.Fields.Item("ID").Value)%>&beginDate = "bla"&enddate="blaa
 
Thanks for reply !
I define two dates

Dim beginDate
Dim endDate

then change that part of <a href... >, but still no data on next page. I've input values 100 and 200 to test this

href. detail.asp?ID=<%=(Recordset2.Fields.Item("ID").Value)%>&beginDate = "100"&enddate="200"

and on next page:

Dim date1
date1=Request("beginDate")

then comes
<Input name="dt1" value="<% Response.Write(Request("date1") %>">

but it stayes empty. Am I doing somethig wrong ?



 
href. detail.asp?ID=<%=(Recordset2.Fields.Item("ID").Value)%>&beginDate = "100"&enddate="200"

With this line you are sending the values through the querystring and not the form.
So in your other page instead of <Input name="dt1" value="<% Response.Write(Request("date1") %>">

Try Response.write(Request.querystring("beginDate"))

OR

Dim date1
date1=Request.Querystring("beginDate")

<Input name="dt1" value="<%= date1 %>">

 
also..it seems the test numbers are not variables(hardcoded)...remove the extra quotes

...note...you can use a shortcut for the recordset object value(easier code to maintain/read/debug)

Code:
<a href = "detail.asp?ID=<%=Recordset2("ID")%>&beginDate =100&enddate=200"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top