473,385 Members | 1,342 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,385 software developers and data experts.

asp:DropDownList SelectedItem problem

Ive stumbled into one of those infamous problems where something
stopped working for apparently no reason - in this case
MyDropDownList.SelectedItem.Value. Im not sure exactly which group this
should be posted in either so Im just trying general.

I have an asp:dropdownlist in a form that is loaded with records from a
database. Upon clicking a button, a subroutine SubmitHandler is called.
The problem is that no matter which entry in the dropdownlist is
selected when the form is submitted, the value that I am recieving in
the subroutine SubmitHandler is always the first item in the
dropdownlist.

Does anyone know what is wrong? Thanks in advance.

Jeff

Dec 20 '05 #1
2 1303
Jeff,
Ive stumbled into one of those infamous problems where something
stopped working for apparently no reason - in this case
MyDropDownList.SelectedItem.Value. Im not sure exactly which group this
should be posted in either so Im just trying general.
You have in my opinions two options to choose from the three of the five
most active developper newsgroups (the other two are not direct dotnet)).

microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.languages.csharp
microsoft.public.dotnet.framework.aspnet

If you don't use codebehind, than I would go to the last in the other
situation to one of the first two.
I have an asp:dropdownlist in a form that is loaded with records from a
database. Upon clicking a button, a subroutine SubmitHandler is called.
The problem is that no matter which entry in the dropdownlist is
selected when the form is submitted, the value that I am recieving in
the subroutine SubmitHandler is always the first item in the
dropdownlist.


This is almost forever a binding problem. (It is done to early or to late).

I hope this helps,

Cor
Dec 20 '05 #2
Thanks! Ill try in one of those.

Jeff

Dec 20 '05 #3

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

Similar topics

1
by: Marius | last post by:
Hi all, I need an asp:dropdownlist on a webform that is databound to a dataset. This works fine and returns the data to populate my dropdownlist. In the DB I only have valid data, but I need a...
1
by: Harry | last post by:
Hi, Just seeing if anyone can help me with a problem I am having with drop down lists. - I have a asp:dropdownlist that gets its values from a database. - The user then selects a value then...
2
by: amessimon | last post by:
I need to display a drop down list which holds up to 250 listitems. I'd like to create this programmatically rather than have to hardcode it into the page. For example <asp:DropDownList...
1
by: Urmal Patel via .NET 247 | last post by:
I have problem with asp:Dropdownlist. I have a dropdownlist control in Page1.aspx and I want to assign value and Text to dropdown list form Page2.aspx from java script function. I am able to assign...
7
by: Lastie | last post by:
Hi all, I’ve got a ‘dropdownlist’ web control and I can add ‘listitem’ no problem. I can also bind data from an SQL database fine. My problem is that I want to do both at the same...
2
by: HH | last post by:
Hi, I have a dropdown list that is datafilled via a SQL table. The text part is always unique. (A list of countries) Each country is assigned one of three numbers. (This being the 'value' of...
1
by: Miguel Dias Moura | last post by:
Hello, I have two questions concerning Asp:DropDownList 1. How to fill a DropDownList from runtime and set its default item? 2. How do use a DropDownList in each datagrid record? All...
2
by: John Smith | last post by:
I have this DataGrid: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server"...
4
by: garyhumf7 | last post by:
I have placed a dropdown list in the edititemtemplate of a formview control and followed specific MSDN instructions on how to bind the list source to a separate SQL lookup data source but have the...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.