Solved

How can I pass Id value with the link

Posted on 2011-09-20
5
416 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
ID: 36569406
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 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.
0
 
LVL 1

Author Comment

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

Expert Comment

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

Author Comment

by:lucky20
ID: 36569944
I got it..it hut spemm mistake..

thanks
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Html fieldset fix its height and width 4 34
Generate Unique ID in VB.NET 21 69
looking for an ASP.net report designer 4 13
Designing forms 3 19
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 demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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