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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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