Solved

How can I pass Id value with the link

Posted on 2011-09-20
5
412 Views
Last Modified: 2012-05-12
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
Comment
Question by:lucky20
  • 2
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
pateljitu earned 250 total points
Comment Utility
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
 
LVL 33

Assisted Solution

by:paulmacd
paulmacd earned 250 total points
Comment Utility
Yes, your solution is the correct one.  I don't know how else you'd assoicate the ID with a given link otherwise.
0
 
LVL 1

Author Comment

by:lucky20
Comment Utility
but when I execute form1.asp
it is showing id value as blank.
0
 
LVL 33

Expert Comment

by:paulmacd
Comment Utility
Does the ID field exist?  Does it have a value for all records?
0
 
LVL 1

Author Comment

by:lucky20
Comment Utility
I got it..it hut spemm mistake..

thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

15 Experts available now in Live!

Get 1:1 Help Now