Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Index value in EventArgs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 06 Dec 2007 09:08 GMT
Hey

ASP.NET 2.0

When the selection in a DropDownList is changed, an
SelectIndexChanged(object sender, EventArgs e) is triggered.

I'm wondering if it is possible to get the new selected index item from the
e argument in this event?

I know I can use for DropDownList1.SelectedIndex, but thought using "e"
would be better

any suggestions?
Jeff - 06 Dec 2007 09:13 GMT
opps, it is the new selectedValue I'm looking for not the selectedIndex.
AFAIK selectedIndex returns an int but selectedValue returns the selected
value (the value of the valuefield at the selected position in
dropdownlist)...

any suggestions on how to get this SelectedValue from the EventArgs e
argument?
Andrew Morton - 06 Dec 2007 12:33 GMT
> opps, it is the new selectedValue I'm looking for not the
> selectedIndex. AFAIK selectedIndex returns an int but selectedValue
[quoted text clipped - 3 lines]
> any suggestions on how to get this SelectedValue from the EventArgs e
> argument?

It's in the sender, not e.

val=ctype(sender, dropdownlist).selectedvalue

Andrew
Mark Rae [MVP] - 06 Dec 2007 09:58 GMT
> I'm wondering if it is possible to get the new selected index item from
> the e argument in this event?

No.

> I know I can use for DropDownList1.SelectedIndex, but thought using "e"
> would be better

Why?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.