Drop Down List + Email

J

James

Hello,

I am new to ASP and two questions (sorry about asking two at once)

1, I have a access database and one of the fields is a combo box linked to
another table, its bound field is a number, there is a description for that
number in the other table. In Access I can hide the first colomb and display
the second, so it shows the text. How do I do that in ASP as I have tried
everything but it just shows the number?

2. I have a list of people in Grid View, one of the fields shown is Email
address. How do I make that field a hyperlink to a email address? I can make
it a hyperlink but it thinks it is a webpage. Basicaly so someone can click
on it and it will start an email, so something like hyperlink = "mailto:" &
or thats how I would do it in VB.

Many thanks for your help in advance

James
 
D

Dhaval.Parmar

I am making assumption that question is about ASP.Net not ASP.

1. On the first one all you have to do is create a datatable (or any
data holder) with two columns (or public property) and then fill the
information from two different tables that you need.

After that you can assign this datatable as datasource to the combobox
and whichever value you want to assign as display field you can set as
DataTextField and whichever value you want to use as valuefield you can
set as DataValueField.

So, in your case dataValueField will be number and dataTextField will
be Description.

something like this

' Specify the data source and field names for the Text and
' Value properties of the items (ListItem objects) in the
' DropDownList control.
DropList.DataSource = 'Your datatable with two column"
DropList.DataTextField = "Description"
DropList.DataValueField = "Number"

' Bind the data to the control.
DropList.DataBind()

2. For second item there are quite a few ways to do it. For one, you
should be able to use template control and within that use hyperlink
control and assign its navigate URL property to mailTo format.

that should work.

This is a starter for gridView

http://asp.net/QuickStart/aspnet/doc/ctrlref/data/gridview.aspx

thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top