473,406 Members | 2,620 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,406 software developers and data experts.

dropdown - parse item - postback

I have a dropdown control for a mobile form,

<mobile:SelectionList id="NumberList"
OnSelectedIndexChanged="NumberList_Command"
runat="server"></mobile:SelectionList>

The code I'm using in the method is,

void NumberList_Command( Object Source, EventArgs E ){
labelselect.Text= NumberList.SelectedItem.Text;
}

Which give me an error. What is the proper code to find what text is
selected in the SelectionList control, and can I make it fire automatically
when it is changed?

Thanks.
Nov 16 '05 #1
1 1309
Let me give a little more information, the line;

labelselect.Text= NumberList.SelectedItem.Text;

is the one the give the error, "
Compiler Error Message: CS0117: 'System.Web.UI.MobileControls.SelectionList'
does not contain a definition for 'SelectedItem'"

This same line works in VB.net.

"Da***@web.com" wrote:
I have a dropdown control for a mobile form,

<mobile:SelectionList id="NumberList"
OnSelectedIndexChanged="NumberList_Command"
runat="server"></mobile:SelectionList>

The code I'm using in the method is,

void NumberList_Command( Object Source, EventArgs E ){
labelselect.Text= NumberList.SelectedItem.Text;
}

Which give me an error. What is the proper code to find what text is
selected in the SelectionList control, and can I make it fire automatically
when it is changed?

Thanks.

Nov 16 '05 #2

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

Similar topics

3
by: Jim Mitchell | last post by:
My Goal is to have a dropdown (DL2) filled from the selectIndexChange event of a primary dropdown (DL1). These are picklists that will be selected frequently. Can someone recommend a strategy...
1
by: Jim Corey | last post by:
I'm thinking this problem is not specific to ASP.NET but anyway: I have a dropdown that I populate when the page loads, and I have values that are different from the text that displays, so the...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
5
by: david | last post by:
I have a question in the following. Any one could give me a help? Thanks David The dataset is declared and created at Class level. My source code is here: Private Sub...
4
by: Dica | last post by:
i've got a dropdown list with various options added to it. i want to add a button that allows the user to "Add New Option' which should create a blank row on the dropdown list and allow the user to...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: Pablo | last post by:
Hi at all! I have a problem (what's new! :P). I have two dropDown and two ODS. The dropDown filter each other at postback. When I select an item of the first DD, it fire a postback and filter...
1
by: Deepson Thomas | last post by:
Hi, Currently iam facing a strange problem.. One dropdown in my page is keeping itz state after postback. Whichever the item i selected is not the selected item after postback. it goes back to the...
5
by: Deepson Thomas | last post by:
Hi, Currently iam facing a strange problem.. One dropdown in my page is not keeping itz state after postback. Whichever the item i select irrespective of that after the post-back the default...
4
by: Ronny Mandal | last post by:
Hi! I have an .aspx with some controls that are created dynamically. The items are populated into the box by setting the DataSource-property to a list. In addition I specify the text and value...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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...

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.