473,568 Members | 2,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp:DropDownLis t SelectedItem problem

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

I have an asp:dropdownlis t 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 1314
Jeff,
Ive stumbled into one of those infamous problems where something
stopped working for apparently no reason - in this case
MyDropDownList. SelectedItem.Va lue. 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.publi c.dotnet.langua ges.vb
microsoft.publi c.dotnet.langua ges.csharp
microsoft.publi c.dotnet.framew ork.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:dropdownlis t 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
342
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 option like "< Select a Region>" to be displayd as teh selected value. Currently it displays the first value of the returned dataset. I cannot seem...
1
2464
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 presses the submit button. - The submit button then calls a function that sets a asp:lable to that value selected. - PROBLEM: No matter what value...
2
9561
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 id="numYears" runat="server" name="numYears"> <asp:ListItem Value="0" Text="0 years" Selected="true" /> <asp:ListItem Value="1" Text="1 year"/>
1
2268
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 values to asp:textbox but not asp:dropdownlist code is as follow when i call this function BindShipper(); function BindShipper(SearchResultFor,...
7
2023
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 time to allow me to have the first option in the list a ‘listitem’ saying something like ‘please pick an option’, and then the rest of options...
2
4716
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 the ddl.) ie: Country Value Australia 1
1
1554
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 dropdownlist should be filled with the values in field NAME from the same dataset used in the datagrid. The default value of each dropdownlist should be...
2
1973
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" Text='<%# Container.DataItem("SM") %>'> </asp:Label> </ItemTemplate>
4
3234
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 formview bound to the main data source. If I set the selecteditem value to bind to the formview control I always get the following error:...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6277
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.