Drop Down list

G

Guest

I have a dropdown list.

It has following items

(e-mail address removed) Admin Miller
(e-mail address removed) Bobby Gill
(e-mail address removed) chris Ghai
(e-mail address removed) Jim Ghotra

Here each item represent email address and his first name and last name. I
need to select an item from drop down list and grab only email ID when I
click on a button.
The domain of email is always same. i.e @sam.ca.gov is always same for all
users.

Thanks in advance
 
S

Sam

Since your domain always the same, you can use SubString method to get the
first part of the email address (before the @ sign). Depending how you bind
your control to its source, you can also set the first part of the email
address to the value field of the dropdown
 
D

David Wier

Is all of that visible, in the list of DDL items, or is the email address
used as the value?

dim sItem as string = ddl.SelectedItem.Text ' << or if email address is the
value, substitute 'Value' for 'Text', here
label1.text=sItem .Substring(0,sItem.IndexOf("@"))

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup
 
G

Guest

Could ypou please give me the code

Sam said:
Since your domain always the same, you can use SubString method to get the
first part of the email address (before the @ sign). Depending how you bind
your control to its source, you can also set the first part of the email
address to the value field of the dropdown
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top