473,657 Members | 2,801 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("S electID").Count
response.write Request.Form("s elAcadLevel")(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 4468
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("S electID").Count
response.write Request.Form("s elAcadLevel")(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="myControlN ame") 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...@yah oo.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("S electID").Count
response.write Request.Form("s elAcadLevel")(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="myControlN ame") 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="multi ple">
<OPTION VALUE="one">one </OPTION>
<OPTION VALUE="two">two </OPTION>
<OPTION VALUE="three">t hree</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
7711
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 when CH1 and CH2 have been choosen. $_GET gives me "CH2". Is there any way to get all the choosen channels elements? I would be very appreciative for any help. Thank you in anticipation. Regards
3
3027
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 created as selected. May somebody give me an explanation ? <input type="button" value="test" onclick="test()"/> <select name="tagSelect" style="width:100%"> </select>
6
4288
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. Based on the number of variables passed through a GET string, I want to multiply the total number of selected items for each together to see how many possible combinations the selected items are generating. The following snippet of code...
6
7252
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 changes just don't make it onto the screen. Am I doing something wrong here? If not, is there a better feature test I can use than "appName.match()"?
2
3650
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 /////////////////////////////////////////////////////////////////////////////////////// <form action="whatever.php" method="post"> <select name="zip_code" onchange="makeRequest('getCity.php?state='+this.form.zip_code.options.value)" multiple="multiple" size="20">
4
2460
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 value of an option in a select statement: <select id="usertypes" multiple="multiple"> <option value="0033">data1</option>
6
9413
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 report" button located on my form to print all of the list box values (that have been updated via selection from combo boxes) from the form to the report. I've tried using a macro with the code: Macro Name: cmdGenerateReport : On Click Action:...
3
2703
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 allows me to filter based on variables in a single table. I would like to have a search form where I can select multiple variables (from various linked tables) to filter by, and return results based on this multi-table filter. Allen Browne has a...
1
4153
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 allows me to filter based on variables in a single table. I would like to have a search form where I can select multiple variables (from various linked tables) to filter by, and return results based on this multi-table filter. Allen Browne...
0
8403
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
8316
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8737
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...
0
8610
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...
0
7345
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
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
5636
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
4168
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
2735
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

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.