Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / July 2007

Tip: Looking for answers? Try searching our database.

How to achieve multiple select using DDL or even HTML Select

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Problematic coder - 12 Jul 2007 17:39 GMT
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
rowe_newsgroups - 12 Jul 2007 18:08 GMT
> 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
[quoted text clipped - 16 lines]
>
> 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
Problematic coder - 12 Jul 2007 19:09 GMT
> > 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
[quoted text clipped - 26 lines]
>
> - 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.