• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

How can I pass Id value with the link

Hi,

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
<%
OpenSQLConn
SQL="select * from table1"
set rs=Conn.Execute(SQL)
%>

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

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
0
lucky20
Asked:
lucky20
  • 2
  • 2
2 Solutions
 
pateljituCommented:
Here is example on similar approach you mentioned:

http://www.kamath.com/columns/squareone/so003_aspvalues.asp

the e.g. you provide will work:

<a href="form2.asp?Id=<%= rs("Id") %>><%= rs("Name") %></a>
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Yes, your solution is the correct one.  I don't know how else you'd assoicate the ID with a given link otherwise.
0
 
lucky20Author Commented:
but when I execute form1.asp
it is showing id value as blank.
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Does the ID field exist?  Does it have a value for all records?
0
 
lucky20Author Commented:
I got it..it hut spemm mistake..

thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now