473,775 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

send argument in a drop down list

hi,

if i cause the onclick event to fire with an ImageButton I can send
CommandArgument which I find really handy to grab some relevant value (which
means i can reuse code for many buttons and just check the
sender.commanda rgument)

i want to do the same thing with 10 dropdownlists. i.e.
onselectedindex changed fire the same event and pass an integer each time,
thats the only diff, rest is common. At the moment I'm doing a switch case
statement on 10 drop down lists to check for the sender.id which is obviously
much longer than just checking a parameter value. CommandArgument isnt a
member of DDL though. how do I send my own value to the event handler as I
can do with the imagebutton??
Nov 19 '05 #1
2 2562
JV
I'm puzzled about your approach. What int do you want to send? Probably an
int associated with the selected row of the DDL? If so, why bother passing
it. Just check which row is selected in your event handler.

"louise raisbeck" <lo************ @discussions.mi crosoft.com>
hi,

if i cause the onclick event to fire with an ImageButton I can send
CommandArgument which I find really handy to grab some relevant value
(which
means i can reuse code for many buttons and just check the
sender.commanda rgument)

i want to do the same thing with 10 dropdownlists. i.e.
onselectedindex changed fire the same event and pass an integer each time,
thats the only diff, rest is common. At the moment I'm doing a switch case
statement on 10 drop down lists to check for the sender.id which is
obviously
much longer than just checking a parameter value. CommandArgument isnt a
member of DDL though. how do I send my own value to the event handler as I
can do with the imagebutton??

Nov 19 '05 #2
Thanks JV, no its not SelectedValue I'm after..I already do something else
with that.

So this is simplified syntactically but i'd want to do something like ..

theselectedvalu e = (DropDownlist)s ender.SelectedV alue;
anothervalue = sender.commanda rgument (which i cant use); //another value
sent on the selectedindexch anged event (my problem is I dont know how to send
another parameter to the event).

Its another value. I have a table with several drop downs all doing the same
thing with only one variable integer value for each..in addition to the
SelectedValue.

I could put it in the Item.Value property with a tilda ~ seperating it and
the other value then extract it with Split but its messy.

In a nutshell. Can I do the same as send CommandArgument just as I can with
ImageButton?? If the answer is no then I think tilda is my only option.

I could always do seperate functions for each drop down and call the common
code in one function.

Thanks.

"JV" wrote:
I'm puzzled about your approach. What int do you want to send? Probably an
int associated with the selected row of the DDL? If so, why bother passing
it. Just check which row is selected in your event handler.

"louise raisbeck" <lo************ @discussions.mi crosoft.com>
hi,

if i cause the onclick event to fire with an ImageButton I can send
CommandArgument which I find really handy to grab some relevant value
(which
means i can reuse code for many buttons and just check the
sender.commanda rgument)

i want to do the same thing with 10 dropdownlists. i.e.
onselectedindex changed fire the same event and pass an integer each time,
thats the only diff, rest is common. At the moment I'm doing a switch case
statement on 10 drop down lists to check for the sender.id which is
obviously
much longer than just checking a parameter value. CommandArgument isnt a
member of DDL though. how do I send my own value to the event handler as I
can do with the imagebutton??


Nov 19 '05 #3

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

Similar topics

2
384
by: Benny | last post by:
Hello Experts, I have a drop down list web control in one of my page. Currently if I want to expand the drop down list to show all items, I must click on the down-arrow sign on the right hand side of the drop down list. The question is what are the codes to make it expand to show all items automatically when it is selected? Thanks,
3
14223
by: Miguel Dias Moura | last post by:
Hello, i have an ASP.NET / VB page where i have a few 4 groups of Drop Down Lists. Each group of Drop Down Lists include 3 Drop Down Lists for date such as: DAY, MONTH, and YEAR. I don't want to insert the values and text to each drop down list. So i want to create a script that populates a certain Drop Down List with certain values when page loads such as:
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
4232
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();
0
465
by: kavi | last post by:
Can anyone send me the script for supplying the values in drop down list of the web page? I have couple of drop down list controls in my web page. I need to supply multiple values for each dropdown list in my script. How can i do that? can you send me the script for this? Thanks in advance reddy
1
4780
by: lantamer | last post by:
Hi I need to make script that creates drop-down list from text file (new line in text file – new line in drop-down list). Somebody told me that I should use Ajax and XMLHttpRequest for that, so I have found on internet script that can write content from text file on screen, but I don’t know how to modify it to write it in drop-down list. How to add reference.value to make values for drop-down? This is it: <html> <head>
2
6930
by: kalaivanan | last post by:
hi, i am developing web application using c#. in a particular page i am using two drop down list boxes, one for product and the other for corresponding models of a product. whenever i select a product the corresponding models will be populated in the model drop down list. and i am using ajax for populating the model ddl. hence the model ddl will be populated at the client. now when i do my processing using the datum in the page i am...
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...
2
14392
by: McGeeky | last post by:
Hi. I have a read only GridView. For each row I want to display a drop down list which contains a list of actions the user can select from for that particular row. E.g. "view details". When they select an action in the drop down list I want to do a post back. How will I know which row they made the selection in? Is there a way to embed the row Id in the drop down list so it gets sent back to the server? Thanks
2
3339
by: crazychrisy54 | last post by:
Hi there I have a option, select drop down list which a user can open. My page however refreshes very frequently and when this occurs the selected drop down list will pop back up. The user then has to open the drop down list again. I just wondered if there was a way using javascript to firstly detect if the user has selected the drop down list and if so, on refresh to set that drop down list to stay dropped down?
1
10051
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
9916
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7464
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6718
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
5360
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...
0
5486
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4017
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
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2853
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.