Getting the Value of a DropDownList

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

I have a Repeater that is paginated, and I would like the user to
navigate to each page via a DropDownList. I have set the AutPostBack
attribute to true and written code that fires on the
OnSelectedIndexChange event. However, I am unable to retrieve the
value of the DropDownList after the PostBack. I have tried
dropdown.SelectedValue, dropdown.SelectedItem.Value, and
dropdown.SelectedIndex. None of these returns the page that was
selected pervious to the postback.

Can anyone shed light on this issue?


Thank you!
 
Hi John,
There are 2 possible solutions to this:

1. Use the http referrer server variable to get the last page
2. Cast the control in the repeater as a DropDownList first, then try to get
the selected value information (similar to reading the value of a control in
the edit state of a datagrid).

HTH.
Ck
 

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

Back
Top