473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Getting the Value of a DropDownList

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!
Jul 22 '05 #1
1 1740
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
"John Smith" wrote:
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!

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Earl Teigrob | last post by:
I want to write a function where I pass in a reference to a dropdownlist and a "match value" and have it returns the index of the dropdownlist item that matchs (or -1 if there is no match) ...
4
by: Rob Venable | last post by:
Hi all, Can anyone tell me how to retrieve the ID of a selected item from a DropDownList. My query brings back the ID and value and I cycle through the .Read Method to add items to the...
0
by: Tim Zych | last post by:
I'm having problems with a dropdownlist control. I fill the control with values in the page_load event. But when I click the button the dropdownlist control gets cleared out. How do I use a...
6
by: Teep | last post by:
Below is my code for dropdownlist that is populated from a SQL table. After a selection from the ddl, a datagrid is suppose to come up pertaining to the information selected, but I keep getting a...
5
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
1
by: imranabdulaziz | last post by:
Dear All, I am mess with one situation let me explain the scenario. I am making search form where I display 15 field in checkboxlist and user select one or two or three or any no to all field....
0
by: munya | last post by:
I am new in .asp I am trying to use dropdownlist to display values from the database and be able to query the database based on displayed values in a dropdownlist. the prob is when I select any...
2
by: mylog | last post by:
Hi I am having a problem of getting the value from the dynamically generated table and dropdownlist. What I am facing is, I have created a table in the aspx page and now I need to add values to...
3
by: E11esar | last post by:
Hi there. I have created a DropDownList in asp.net with declaration in the aspx file as follows: <asp:DropDownList ID="lbExtractType" runat="server"> <asp:ListItem Value="...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.