Solved

How can I pass Id value with the link

Posted on 2011-09-20
5
415 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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASCX file or a newer alternative? 1 36
ASP.net VB.net Highlight html text in yellow in body of email 5 24
age from date of birth 4 43
Footer for each row on Gridview 2 21
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

831 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