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

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.commandargument)

i want to do the same thing with 10 dropdownlists. i.e.
onselectedindexchanged 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 2511
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.microsoft.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.commandargument)

i want to do the same thing with 10 dropdownlists. i.e.
onselectedindexchanged 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 ..

theselectedvalue = (DropDownlist)sender.SelectedValue;
anothervalue = sender.commandargument (which i cant use); //another value
sent on the selectedindexchanged 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.microsoft.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.commandargument)

i want to do the same thing with 10 dropdownlists. i.e.
onselectedindexchanged 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
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...
3
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...
2
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...
5
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);...
0
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...
1
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...
2
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...
3
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...
2
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...
2
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.