p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 19th, 2009, 03:43 PM
Friend of Wrox
Points: 577, Level: 8
Points: 577, Level: 8 Points: 577, Level: 8 Points: 577, Level: 8
Activity: 5%
Activity: 5% Activity: 5% Activity: 5%
 
Join Date: Apr 2005
Location: Kolkata, West Bengal, India.
Posts: 115
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old October 20th, 2009, 10:30 PM
Authorized User
Points: 72, Level: 1
Points: 72, Level: 1 Points: 72, Level: 1 Points: 72, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ListBox selected item retrieval help JLynn Beginning VB 6 4 October 23rd, 2009 02:01 AM
ListBox not showing correct selected value Shokwave ASP.NET 2.0 Basics 4 June 4th, 2007 09:23 AM
Get selected values from ListBox to DetailsView gerten ASP.NET 2.0 Professional 0 October 12th, 2006 02:21 PM
Set Listbox Selected property DaDeViL VB How-To 7 October 4th, 2006 05: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 02:42 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc