473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Form database contents hyperlink

I'm using ASP.Net and SQL Server. I have a table called states. I have 2
forms.
On form 1 is the 50 states in textboxes created with a loop.
I want to have those 50 or 45 or whatever amount of states have a hyperlink.
Once you click the hyperlink it will take the stateId from the click event
and use the Get method to send it to the next page.
Page 2 will simply use the browswer get method to show information based on
that stateid.
So my question is how to create a text hyperlink using a loop that onclick
of hyperlink it opens up the next page like: http://www.etc.com?stateid.
How do I create that hyperlink?

Thanks.
Nov 18 '05 #1
2 1754
First of all, if you have a table called states, you probably have there a
record for every state. Then why do you need a loop to create textboxes? You
can use a datagrid or datalist or repeater and databind it to the table.
Even if you for whatever reason want textboxes, you can make a templated
column.

Now, there is a server control called HyperLink You can either use it
instead of the textbox or next to the textbox. You will have to setup in
runtime its property NavigateUrl. If you are using a loop, do it in the
loop. If you switch to a datagrid/datalist/repeater, use either databinding
expression or ItemDataBound event. That is the direction. The details you
can work out yourself.

Eliyahu

"Big E" <no****@nospam.com> wrote in message
news:Ov*************@tk2msftngp13.phx.gbl...
I'm using ASP.Net and SQL Server. I have a table called states. I have 2
forms.
On form 1 is the 50 states in textboxes created with a loop.
I want to have those 50 or 45 or whatever amount of states have a hyperlink. Once you click the hyperlink it will take the stateId from the click event
and use the Get method to send it to the next page.
Page 2 will simply use the browswer get method to show information based on that stateid.
So my question is how to create a text hyperlink using a loop that onclick
of hyperlink it opens up the next page like: http://www.etc.com?stateid.
How do I create that hyperlink?

Thanks.

Nov 18 '05 #2
Another way would be to use Literal control and add the content between an
<a> tag.

"Eliyahu Goldin" <re*************@monarchmed.com> ¦b¶l¥ó
news:uC**************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
First of all, if you have a table called states, you probably have there a
record for every state. Then why do you need a loop to create textboxes? You can use a datagrid or datalist or repeater and databind it to the table.
Even if you for whatever reason want textboxes, you can make a templated
column.

Now, there is a server control called HyperLink You can either use it
instead of the textbox or next to the textbox. You will have to setup in
runtime its property NavigateUrl. If you are using a loop, do it in the
loop. If you switch to a datagrid/datalist/repeater, use either databinding expression or ItemDataBound event. That is the direction. The details you
can work out yourself.

Eliyahu

"Big E" <no****@nospam.com> wrote in message
news:Ov*************@tk2msftngp13.phx.gbl...
I'm using ASP.Net and SQL Server. I have a table called states. I have 2
forms.
On form 1 is the 50 states in textboxes created with a loop.
I want to have those 50 or 45 or whatever amount of states have a

hyperlink.
Once you click the hyperlink it will take the stateId from the click event and use the Get method to send it to the next page.
Page 2 will simply use the browswer get method to show information based

on
that stateid.
So my question is how to create a text hyperlink using a loop that onclick of hyperlink it opens up the next page like: http://www.etc.com?stateid.
How do I create that hyperlink?

Thanks.


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: B Love | last post by:
I am trying to insert a hyperlink field which will link to a JPEG file in a folder on a server but for some reason, I am unable to do so. I can enter the same information in a browser, and it...
13
by: MLH | last post by:
I have a RDBMS app consisting of 3 primary mdb's... 1) a front-end with a few STATIC tables and the other menagerie of objects 2) a back-end with most of my DYNAMIC tables. I'll call it my main...
1
by: jm | last post by:
<td> <asp:HyperLink id="ORDER_ID" NavigateUrl= '<%# DataBinder.EvalContainer.DataItem, "ORDER_ID")%>' runat="server"> <%# DataBinder.Eval(Container.DataItem, "ORDER_ID") %> </asp:HyperLink>...
2
by: c676228 | last post by:
Hi, This is my first time to post asp.net question on this forum. I have a question for "How to pass the first form value to the next form" I have enrollinfo.aspx form which look like as follow:...
5
by: kbrad | last post by:
I have an Access database set up with a number of text fields and a hyperlink field which references a different image per record. I am trying write ASP code to retrieve allt his data and images...
1
by: steventhomas42 | last post by:
Greetings, I am creating a website for a volunteer-based organization that would like to accept volunteer registrations online. They want the visitors to fill out a simple form to submit and...
6
by: Michael Kintner | last post by:
I am looking for add-on tools or code to allow me to attach scanned PDF documents to a database record. I would like to know if there are developer tools out there that can do the following: -...
13
ADezii
by: ADezii | last post by:
Recently, there have been several questions and much confusion concerning the Topic of Hyperlinks. Specifically, Users wanted to know how to retrieve a File Name from a FileDialog Box, copy the Name...
5
LAD
by: LAD | last post by:
Using Access 2003 on Windows 2000. My Skill Level: Med Low (Some VBA, okay with Access) Form: Single View - based on Query of single Table to sort by field. Application: Dealers email 'contract...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.