Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2007, 01:56 PM
Authorized User
 
Join Date: Sep 2006
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Value Query

Hi,

I wondered if someone could assist with a query I have ? Using asp.net 1.1 and vb.net 2003, I want to set up some hyperlinks on a page. Within these hyperlinks I want to assign a different value to each hyperlink so that when each link is clicked on, a function will display a list of items dependent upon which hyperlink and associated value is selected.

After clicking on the hyperlink, the person is then re-directed to another page. Now how can I set the value on the first page and then pass that value onto the second page ?

I thought of the following :

Set the value e.g. <a id="activebass" href="activebass.aspx">

Then I thought I would pass this value by the session object. So I used something like this :

 Dim id As String
 Session("LinkID") = id

However when I try to write out this id value on the next page, nothing appears - so the above code is failing.

How can I reference the hyperlink value id "activebass" given this is not working ? Can you pass more than one value via the session object as I already use the Session object to pass a CartID value and can you pass strings ?
Can anyone advise where I seem to be going wrong ?

Thanks,


 
Old June 24th, 2007, 06:08 PM
Authorized User
 
Join Date: Jun 2007
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hericles
Default

Hi,
You can add to the link href which may be simply than using session state. You can simply add the variable as a name/value pair like this:
href="myPage.aspx?name=value"
In the called page (myPage.aspx in this case) the query string can be pulled out of the URL by the Rsponse.Query method (google this, I can't remember the code off the top of my head).
Hope that helps.
Steve

 
Old July 2nd, 2007, 11:49 AM
Authorized User
 
Join Date: Sep 2006
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks - worked nicely :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Variable Query rsm42 ASP.NET 1.0 and 1.1 Basics 1 February 10th, 2007 01:05 PM
Passing Variable to Query dalezjc Classic ASP Databases 2 November 14th, 2006 03:27 PM
passing parameter to query vladimir Access 6 August 30th, 2006 05:39 AM
Passing values to query Lynque Classic ASP Databases 2 December 11th, 2004 05:52 AM
Query Regarding passing Of Values gadhiav ASP.NET 1.0 and 1.1 Basics 5 July 16th, 2004 05:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.