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
 

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

validation 1
drop list question 2
drop down list problems 3
Annoying drop down list... 1
Drop Down Lists and Macros 2
Question about drop down lists 1
Drop-down list and error message 1
Drop Down List User Control 1

Back
Top