Solved

How can I pass Id value with the link

Posted on 2011-09-20
5
417 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
[X]
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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Technology Resume 7 88
Diff of the day 2 43
asp.net mvc5 6 34
SQL query joining 6 tables in asp.net 4 33
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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