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

How to retreive Value of Dropdown in Web Form

I have 2 Dropdown's in a Web FormView. I would like to get one to be a
Parameter for the other, but I can't seem to figure out how to get the
value out of the first. When I double click it to get to the C#
Window...neither of the Dropdowns are available to get the Value or set
a profile. How can I get this Value?

Jul 10 '06 #1
3 1844
Hello Dave,

DI have 2 Dropdown's in a Web FormView. I would like to get one to be
Da Parameter for the other, but I can't seem to figure out how to get
Dthe value out of the first. When I double click it to get to the C#
DWindow...neither of the Dropdowns are available to get the Value or
Dset a profile. How can I get this Value?

It seems that you have no declaration of the control in the C# code.
Try to double-click on your control from the web form designer to get the
handler in C# code.

To get values Item[control.SelectedIndex].Value property of the control
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 11 '06 #2
Thanks Michael,
I've tried that. The only option available is
DropdownList1_SelectedIndexChanged. Under normal conditions (controls
outside the FormView), it would be DropdownList1.SelectedValue. This
is what's confusing. I'm not sure how to retreive the value for a
control inside the FormView.

Michael Nemtsev wrote:
Hello Dave,

DI have 2 Dropdown's in a Web FormView. I would like to get one to be
Da Parameter for the other, but I can't seem to figure out how to get
Dthe value out of the first. When I double click it to get to the C#
DWindow...neither of the Dropdowns are available to get the Value or
Dset a profile. How can I get this Value?

It seems that you have no declaration of the control in the C# code.
Try to double-click on your control from the web form designer to get the
handler in C# code.

To get values Item[control.SelectedIndex].Value property of the control
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 11 '06 #3
use (DropDownList)EmployeeFormView.FindControl("dd1") to get that contol

where EmployeeFormView is your view and dd1 is you DropDownList
and then use what I've posted above for that dropDown control
Thanks Michael,
I've tried that. The only option available is
DropdownList1_SelectedIndexChanged. Under normal conditions (controls
outside the FormView), it would be DropdownList1.SelectedValue. This
is what's confusing. I'm not sure how to retreive the value for a
control inside the FormView.

Michael Nemtsev wrote:
Hello Dave,

DI have 2 Dropdown's in a Web FormView. I would like to get one to be
Da Parameter for the other, but I can't seem to figure out how to get
Dthe value out of the first. When I double click it to get to the C#
DWindow...neither of the Dropdowns are available to get the Value or
Dset a profile. How can I get this Value?

It seems that you have no declaration of the control in the C# code.
Try to double-click on your control from the web form designer to get the
handler in C# code.

To get values Item[control.SelectedIndex].Value property of the control
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Jul 11 '06 #4

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

Similar topics

0
by: Mamun | last post by:
Hi All, I have the following case. I am trying to update a table based on the value of dropdown box and checkbox. Here is what I have in page1.asp <table>
24
by: London | last post by:
Hello Can you help me. By ASP How can I get the dropdown(control'name)'s selected value? What is it's property'name?
4
by: Lisa | last post by:
I know this is supposed to be easy but I can't get this to work. I have a dropdown that pulls all the Projects (tp_title) available. All I want to do is get the ID (tp_id) of that record so I can...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
1
by: Mad Scientist Jr | last post by:
I don't know how this is happening, but a dropdown control I have is resetting to the 2nd value on the list anytime a postback occurs. I have no initiation code outside of If Not (IsPostBack) ...
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...
1
by: acord | last post by:
Hi, I am having problem to get a value of the selected item from a dropdown listbox. Here is the JS function; function getSelectedItem(objSelect) { alert("in getSelectedItem"); alert...
2
by: Bruno Alexandre | last post by:
Hi guys, I'm using Javascript to dynamically add to a dropdown values like for ( i=0; i<tv.length; i++ ) { selectDDAvisCtrl.options = new Option(tv, tv); } and I use ...
1
by: deepaks85 | last post by:
Dear Friends, I have create a form in which user can update his/her records. The data can retrieved from the code which i have put in dropdown menu. Now I want to display all the records as per...
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...
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
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...
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,...
0
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...

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.