Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 19th, 2009, 02:43 PM
Friend of Wrox
Points: 686, Level: 9
Points: 686, Level: 9 Points: 686, Level: 9 Points: 686, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Kolkata, West Bengal, India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Getting Listbox selected value into a string

Hi All ,

I am trying to store a single selected value of a Listbox into a string but it's giving me exceptions.

I am doing the following:

[code]

string xx=string.Empty;

xx= lstbox1.SelectedValue.ToString();

This is not working. What is the alternate way to do this. ??

Urgent !!! Please help
  #2 (permalink)  
Old October 20th, 2009, 09:30 PM
Authorized User
 
Join Date: Jun 2009
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi,my friend
Yon should code:
Code:
string ss = this.ListBox1.SelectedItem.Text;
and then U will get the selected value of the listbox,I tried,and it worked fine.
Hope useful for U.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox selected item retrieval help JLynn Beginning VB 6 4 October 23rd, 2009 01:01 AM
ListBox not showing correct selected value Shokwave ASP.NET 2.0 Basics 4 June 4th, 2007 08:23 AM
Get selected values from ListBox to DetailsView gerten ASP.NET 2.0 Professional 0 October 12th, 2006 01:21 PM
Set Listbox Selected property DaDeViL VB How-To 7 October 4th, 2006 04:04 PM
How to get selected Item from Listbox? Iceman571 ADO.NET 1 March 25th, 2004 06:33 AM



All times are GMT -4. The time now is 03:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.