Solved

How to retrieve row selected from dropdownlist?

Posted on 2011-09-15
4
361 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

732 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