You're welcome.
Good Luck!
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| NNTP-Posting-Date: Mon, 15 Aug 2005 21:48:02 -0500
| From: "Dave H" <Da***@noemail. nospam>
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| References: <PK************ *************** **************@ comcast.com>
<AI************ ********@twiste r2.libero.it>
<pq************ *@TK2MSFTNGXA01 .phx.gbl>
| Subject: Re: listbox - mulitple selection detection
| Date: Mon, 15 Aug 2005 19:47:51 -0700
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <C9************ ********@comcas t.com>
| Lines: 91
| NNTP-Posting-Host: 67.180.218.69
| X-Trace:
sv3-pLUCskW8oRVJlJh N5TQ3G7OE2umQhd ZtlRz4BkSwOo6ML IYJqEQC1/Gvq3ntcijMF+Bpo uA8
svnPHi9!AIczeap VDTMhmkBezfj/yPnxqkQ2bhy09u3 4cr7Qae35ZBbfhz 8palfDS05MZPBIy oVi
q4MqXX90!8TAm
| X-Complaints-To:
ab***@comcast.n et
| X-DMCA-Complaints-To:
dm**@comcast.ne t
| X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
complaint properly
| X-Postfilter: 1.3.32
| Path:
TK2MSFTNGXA01.p hx.gbl!TK2MSFTF EED02.phx.gbl!t ornado.fastwebn et.it!tiscali!n e
wsfeed1.ip.tisc ali.net!news.ma xwell.syr.edu!b order1.nntp.dca .giganews.com!l o
cal01.nntp.dca. giganews.com!nn tp.comcast.com! news.comcast.co m.POSTED!not-for
-mail
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:1181 51
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Thanks, to both of you... Dave
|
| "Steven Cheng[MSFT]" <st*****@online .microsoft.com> wrote in message
| news:pq******** *****@TK2MSFTNG XA01.phx.gbl...
| > Thanks for Andrea's inputs.
| >
| > Hi Dave,
| >
| > Since the ASP.NET ListBox dosn't provide buildin property to represent
| > multi selected items(under multi-select mode), generally we need to loop
| > through all the items to check the selection status.
| >
| > Also, I think Andrea's suggestion is a good trick since it directly
| capture
| > the ListBox's html post back datas and analyize it to get whether
there's
| > multi items selected. One correction on the code is that we should use
| the
| > "UniqueID" rather than "clientID" when retrieving control's postback
form
| > data. For example:
| >
| > Request.Form[this.ListBox1.U niqueID]
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure!
www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| > --------------------
| > | From: "Andrea Zani" <an****@aspital ia.com>
| > | Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| > | References: <PK************ *************** **************@ comcast.com>
| > | Subject: Re: listbox - mulitple selection detection
| > | Lines: 22
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Original
| > | X-Antivirus: avast! (VPS 0532-6, 13/08/2005), Outbound message
| > | X-Antivirus-Status: Not-Tested
| > | Message-ID: <AI************ ********@twiste r2.libero.it>
| > | Date: Sun, 14 Aug 2005 08:58:08 GMT
| > | NNTP-Posting-Host: 151.47.29.112
| > | X-Complaints-To:
ab***@net24.it
| > | X-Trace: twister2.libero .it 1124009888 151.47.29.112 (Sun, 14 Aug 2005
| > 10:58:08 MET DST)
| > | NNTP-Posting-Date: Sun, 14 Aug 2005 10:58:08 MET DST
| > | Organization: [Infostrada]
| > | Path:
| >
|
TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!ne wsfeed00.sul.t-online.de!newsf e
| >
|
ed01.sul.t-online.de!t-online.de!nntp. infostrada.it!t wister2.libero. it.POSTE
| > D!not-for-mail
| > | Xref: TK2MSFTNGXA01.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:1178 58
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | Dave H <Da***@noemail. nospam> ha scritto:
| > | > I have an asp:listbox, allowing multiple selections, is there a
quick
| > | > check to see if there's more than one selected, or do I need to go
| > | > through the whole list?
| > | >
| > | > Thanks, Dave
| > |
| > | This is possibile solution:
| > | int
| > |
| >
|
selected=Reques t.Params[ListBox1.Client ID]==null?0:Reques t.Params[ListBox1.C
| > lientID].ToString().Spl it(',').Length;
| > |
| > | if (selected>1)
| > | // multi-select
| > |
| > | --
| > | AZ [Microsoft - .NET MVP]
| > | Mia Home page:
http://ciclismo.sitiasp.it
| > | Asp.Net community:
http://www.aspitalia.com
| > | Il mio blog:
http://blogs.aspitalia.com/az
| > |
| > |
| > |
| > |
| >
|
|
|