How can I pass Id value with the link

Posted on 2011-09-20
Last Modified: 2012-05-12

I am displaying name values in a link dynamically.
Is there any possiblity to pass id value with that.
this the code I have used
SQL="select * from table1"
set rs=Conn.Execute(SQL)

<form method="post" name="form1" action=form1.asp">
<% Do while not rs.eof %>
<tr><td><a href="form2.asp"><%= rs("Name") %></a></td></tr>
<% rs.Move Next 

Open in new window

is there any possiblity to add id value in link..  like this
<a href="form1.asp?Id="<%= rs("Id") %>"><%= rs("Name") %></a>

Open in new window

or Is there any better option to pass the id value
Question by:lucky20
  • 2
  • 2
LVL 15

Accepted Solution

pateljitu earned 250 total points
ID: 36569406
Here is example on similar approach you mentioned:

the e.g. you provide will work:

<a href="form2.asp?Id=<%= rs("Id") %>><%= rs("Name") %></a>
LVL 34

Assisted Solution

by:Paul MacDonald
Paul MacDonald earned 250 total points
ID: 36569413
Yes, your solution is the correct one.  I don't know how else you'd assoicate the ID with a given link otherwise.

Author Comment

ID: 36569434
but when I execute form1.asp
it is showing id value as blank.
LVL 34

Expert Comment

by:Paul MacDonald
ID: 36569442
Does the ID field exist?  Does it have a value for all records?

Author Comment

ID: 36569944
I got hut spemm mistake..


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now