Solved

How to retrieve row selected from dropdownlist?

Posted on 2011-09-15
4
359 Views
Last Modified: 2012-06-27
Hello,

When I select a row from cmbDonor, the value selected is not registered, for example when I try to see the value selected in a meaasge box with the code below, I get the value of the first row, even when I set the Auto postback property to True.
 MsgBox(CmbDonor.SelectedItem.ToString) Any ideas what I'm doing wrong?

Thanks,

Victor
0
Comment
Question by:vcharles
4 Comments
 
LVL 4

Accepted Solution

by:
AnuTiji earned 500 total points
ID: 36547541
Hi

Please make sure that the loading of dropdownlist is written inside (if ( !IsPostback)) in the page load method. Else whenever a selection is made, it will load the dropdown contents again and the first item will be shown in the message box.
0
 
LVL 2

Expert Comment

by:Lord_Death
ID: 36547543
AT First are you reBinding the DropDownList in PostBack.

Fill the DDL in !(Page.IsPostBack) and at the end of your Page_Load get CmbDonor.SelectedValue ,

there shouldnt be a problem...
If this didnt help try to post part of your code.
0
 
LVL 7

Expert Comment

by:mr_nadger
ID: 36547781
is the list being reset when you post back due to code in the page load event not checking for postback=true?
0
 

Author Comment

by:vcharles
ID: 36548168
Hello,

It worked with setting if ispostbsck = false before
The code to load the object.

Thank you for all your comments.

Victor
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delete HTML table rows 12 29
Configure a Bean in an XML file 4 31
ASP.NET(C#) Eliminating weekends from a date range 2 34
Question about JQuery and asp.net 3 26
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question