473,511 Members | 15,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to achieve multiple select using DDL or even HTML Select

I have a need in an application to have the ability to select multiple
values in some kind of drop down list or maybe even a html type select
box.

I have found there doesn't seem to be an option to do this with a
standard asp.net DDL, however it is possible using a html select box,
the problem then is getting the values selected on the code behind
page.

I think in classic asp it would have been something like this:

Dim i as integer
For i = 1 to request.form("SelectID").Count
response.write Request.Form("selAcadLevel")(i) & "<br>"
Next

I am not sure how to translate this into VB.NET or even if it can be
achieved?

Thanks

Jul 12 '07 #1
2 4462
On Jul 12, 12:39 pm, Problematic coder <gnews...@gmail.comwrote:
I have a need in an application to have the ability to select multiple
values in some kind of drop down list or maybe even a html type select
box.

I have found there doesn't seem to be an option to do this with a
standard asp.net DDL, however it is possible using a html select box,
the problem then is getting the values selected on the code behind
page.

I think in classic asp it would have been something like this:

Dim i as integer
For i = 1 to request.form("SelectID").Count
response.write Request.Form("selAcadLevel")(i) & "<br>"
Next

I am not sure how to translate this into VB.NET or even if it can be
achieved?

Thanks
Just add a unique id (id="myControlName") to the html control and a
runat="server" attribute and you should be able to access the control
normally.

Thanks,

Seth Rowe

Jul 12 '07 #2
On Jul 12, 10:08 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On Jul 12, 12:39 pm, Problematic coder <gnews...@gmail.comwrote:


I have a need in an application to have the ability to select multiple
values in some kind of drop down list or maybe even a html type select
box.
I have found there doesn't seem to be an option to do this with a
standard asp.net DDL, however it is possible using a html select box,
the problem then is getting the values selected on the code behind
page.
I think in classic asp it would have been something like this:
Dim i as integer
For i = 1 to request.form("SelectID").Count
response.write Request.Form("selAcadLevel")(i) & "<br>"
Next
I am not sure how to translate this into VB.NET or even if it can be
achieved?
Thanks

Just add a unique id (id="myControlName") to the html control and a
runat="server" attribute and you should be able to access the control
normally.

Thanks,

Seth Rowe- Hide quoted text -

- Show quoted text -
Thanks for replying but I am still struggling with this:

Here is what I have so far:

<select id="SelTestName" style="height: 69px" runat="server"
multiple="multiple">
<OPTION VALUE="one">one</OPTION>
<OPTION VALUE="two">two</OPTION>
<OPTION VALUE="three">three</OPTION>
</select>

As soon as I attempt to switch between from source to design I get the
following error:

Cannot create an object of type 'System.Boolean' from its string
representation 'multiple' for the 'multiple' property

The other problem I have is how do I iterate through the values
selected, since 'count' doesn't seem to be supported as in my example
above.

Or am I going down totally the wrong road and is there a better way of
achieving this?

Thanks
Jul 12 '07 #3

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

Similar topics

6
7704
by: Rolf Wester | last post by:
Hi, I have a form with a select element with multiple="true". When using the GET method (I suppose the same happens with the POST method) I can seen that the form sends channels=CH1&channels=CH2...
3
3017
by: Max Weber | last post by:
Try to run the code below in a page. You will notice than when you switch the multiple attribute of the SELECT tag, only one option is displayed as selected although multiple options have ben...
6
4270
by: Ben Hallert | last post by:
Hi guys, I'm trying to figure out what bone headed mistake I made on something I put together. I've got a form (named 'context') that has a variable number of select-multiple inputs on it. ...
6
7239
by: Adam Tilghman | last post by:
Hi all, I have found that IE doesn't seem to respect the <SELECT> "multiple" attribute when set using DOM methods, although the attribute/property seems to exist and is updated properly. Those...
2
3631
by: areef.islam | last post by:
Hi, I am kinda new to javascript and I am having this problem with selecting multiple options from a select tag. Hope someone can help me out here. here is my code...
4
2442
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
6
9377
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
3
2698
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
1
4130
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
0
7237
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
7349
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
7417
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...
1
7074
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
7506
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...
1
5063
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...
0
4734
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...
0
3219
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...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.