473,748 Members | 9,931 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determining Drop Down List Value

I'm not feeling too smart right now, but 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. Can someone show me what I am doing wrong and
tell me the correct way? Thank you.

In the page load event, I am doing the following:

//Code I use to populate the dropdown list.
ddAssignedTo.Da taValueField = "PersonnelI D";
ddAssignedTo.Da taTextField = "DisplayNam e";
ddAssignedTo.Da taSource = Personnel.List( );
ddAssignedTo.Da taBind();

//Code I use to show the value from the database.
ddAssignedTo.Se lectedValue = problem.AddedBy .PersonnelId.To String();

When I change the drop down to another item in the list, and click my update
button, I get the previous value that was selected on page load.

//Code I use for that is:
ddAssignedTo.Se lectedValue

What am I doing wrong...thank you.
Jan 20 '06 #1
3 12484
Also, I double clicked the control so I could see the selected index change
event fire, but it does not fire. I checked and InitializeCompo nent has the
event in it, but I don't see why that is not running when I select a
different value. Any thoughts on that? Thanks again.

"Mike Collins" wrote:
I'm not feeling too smart right now, but 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. Can someone show me what I am doing wrong and
tell me the correct way? Thank you.

In the page load event, I am doing the following:

//Code I use to populate the dropdown list.
ddAssignedTo.Da taValueField = "PersonnelI D";
ddAssignedTo.Da taTextField = "DisplayNam e";
ddAssignedTo.Da taSource = Personnel.List( );
ddAssignedTo.Da taBind();

//Code I use to show the value from the database.
ddAssignedTo.Se lectedValue = problem.AddedBy .PersonnelId.To String();

When I change the drop down to another item in the list, and click my update
button, I get the previous value that was selected on page load.

//Code I use for that is:
ddAssignedTo.Se lectedValue

What am I doing wrong...thank you.

Jan 20 '06 #2
Mike,
do you have the control's AutoPostBack property set to true?
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Collins" wrote:
Also, I double clicked the control so I could see the selected index change
event fire, but it does not fire. I checked and InitializeCompo nent has the
event in it, but I don't see why that is not running when I select a
different value. Any thoughts on that? Thanks again.

"Mike Collins" wrote:
I'm not feeling too smart right now, but 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. Can someone show me what I am doing wrong and
tell me the correct way? Thank you.

In the page load event, I am doing the following:

//Code I use to populate the dropdown list.
ddAssignedTo.Da taValueField = "PersonnelI D";
ddAssignedTo.Da taTextField = "DisplayNam e";
ddAssignedTo.Da taSource = Personnel.List( );
ddAssignedTo.Da taBind();

//Code I use to show the value from the database.
ddAssignedTo.Se lectedValue = problem.AddedBy .PersonnelId.To String();

When I change the drop down to another item in the list, and click my update
button, I get the previous value that was selected on page load.

//Code I use for that is:
ddAssignedTo.Se lectedValue

What am I doing wrong...thank you.

Jan 20 '06 #3
Sorry it took so long for the reply...I got called away on another project
for a little. Anyway, the AutoPostBack property was set to False. I'm
guessing that it should be set to True?

"Peter Bromberg [C# MVP]" wrote:
Mike,
do you have the control's AutoPostBack property set to true?
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Mike Collins" wrote:
Also, I double clicked the control so I could see the selected index change
event fire, but it does not fire. I checked and InitializeCompo nent has the
event in it, but I don't see why that is not running when I select a
different value. Any thoughts on that? Thanks again.

"Mike Collins" wrote:
I'm not feeling too smart right now, but 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. Can someone show me what I am doing wrong and
tell me the correct way? Thank you.

In the page load event, I am doing the following:

//Code I use to populate the dropdown list.
ddAssignedTo.Da taValueField = "PersonnelI D";
ddAssignedTo.Da taTextField = "DisplayNam e";
ddAssignedTo.Da taSource = Personnel.List( );
ddAssignedTo.Da taBind();

//Code I use to show the value from the database.
ddAssignedTo.Se lectedValue = problem.AddedBy .PersonnelId.To String();

When I change the drop down to another item in the list, and click my update
button, I get the previous value that was selected on page load.

//Code I use for that is:
ddAssignedTo.Se lectedValue

What am I doing wrong...thank you.

Jan 20 '06 #4

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

Similar topics

4
6314
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by the choice from the drop down box. Something like: <form name="populatefrm" id="contactfrm" method="post"
1
2913
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the text boxes? What this script is suppose to do is change the value of a second drop down list based on the selection from the first. Then a value is chosen from the script generated drop down list in the
2
12622
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
5
4230
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1); System.Data.SqlClient.SqlCommand dbCommand1 = new System.Data.SqlClient.SqlCommand();
3
2996
by: John Walker | last post by:
Hi, On an ASP.NET page I have a drop down list control. When the user pulls down the list and makes a selection, I perform validation, and if the validation fails I want the selected item in the drop down box to go back to what the value was before the user tried to change it, but at that point I will not know what the original value was. Or is there a drop down control "revert" method, or is there any way of knowing what the original...
2
4552
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 set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
0
2162
by: weiwei | last post by:
Hi here is my scenario, I create a drop down list in itemtemplate.(that drop down is created from db), after user click edit command, my ideal plan is have another drop down list in edititemtemplate with preselected value from the previous drop down list, so far I can only achieved with the regular drop down list in edititemtemplate with no preselected value from previous one. anyone can help me. thanks in advance. below is my current...
3
7359
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the document selected (my application uses the BusinessObjects Java Web Services SDK) The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do -select a folder from the...
1
5954
by: abTech | last post by:
Have struggled a lot to get a filtered drop down in the normal html and that too editable ... i have used table like auto-completion etc ... This is the simplest solution for a filtered drop down <SELECT NAME="drop" id='drop' onkeyup="editOption(arguments, this)" style='width:100px;cursor:text' mode="1"> <option value="0">Default</option> … </SELECT> Mode 0: Filters the list till a valid match is found, if not found then will behave...
0
8991
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9548
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9374
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
6076
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3315
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
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.