Drop Down list

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top