ASP.net Controls

Listbox.text to textbox.text

Page 1 of 1

5 Replies - 571 Views - Last Post: 03 May 2010 - 11:20 AM Rate Topic: -----

#1 hamidkhl  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-November 08

ASP.net Controls

Posted 02 May 2010 - 10:48 PM

hello
I'm beginner in ASP.net, pleas help me :rolleyes2:
I have one list box, list box have several data from database, I have several textboxes too.
I want to add selected data from listbox to one of my textbox which is selected; in fact which is focused, I already tried this: textbox1.text=listbox.text but it works only for one textbox and I have 42textboxes!!!
best regards,

Is This A Good Question/Topic? 0
  • +

Replies To: ASP.net Controls

#2 b.ihde  Icon User is offline

  • D.I.C for life
  • member icon

Reputation: 43
  • View blog
  • Posts: 1,070
  • Joined: 29-September 08

Re: ASP.net Controls

Posted 03 May 2010 - 02:44 AM

Hi!

textBox1.Text = listBox1.SelectedItem.Text;



This would show only 1 item of the listbox in one textbox..

What are you exactly trying to do? Can u post a picture of your listbox?

Thanks

Ben
Was This Post Helpful? 0
  • +
  • -

#3 hamidkhl  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-November 08

Re: ASP.net Controls

Posted 03 May 2010 - 05:02 AM

Dear Ben, thank you
My problem is about textboxes, I have 42 textbox and only one button for control all textboxes, the problem is this; how can I make a code like this:

textbox(1<i<42).text=listbox.selecteditem.text, which i is focused textbox!!! but "Unfortunately" this kind of coding does not work
thank you again, I'm waiting for replies...

Hamid
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: ASP.net Controls

Posted 03 May 2010 - 06:55 AM

So you want to select an item in the ListBox and set that text to the text of all 42 textboxes?
Was This Post Helpful? 0
  • +
  • -

#5 hamidkhl  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 118
  • Joined: 03-November 08

Re: ASP.net Controls

Posted 03 May 2010 - 07:20 AM

Not all of them, I solve the problem I can use flags
I attached a picture of my web, I wanted code for "select" button; sequence of acts that I wanted:
1) select one of textboxex
2) select one of list box items
3) press button select
4) now selected Item should be in the selected text box
thank you Ben,
may I choose you as a friend? (I mean in blog)

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#6 b.ihde  Icon User is offline

  • D.I.C for life
  • member icon

Reputation: 43
  • View blog
  • Posts: 1,070
  • Joined: 29-September 08

Re: ASP.net Controls

Posted 03 May 2010 - 11:20 AM

hi,

i ve seen you added me in friendlist, but i had no idea who this is, so i deleted you ;)

I added you again ;)

Ya ok, now i know what you mean, should the listbox item you selected once for a textbox be deleted or marked as already selected? So you cannot choose one listbox item for 2 textboxes?

Greetz

Ben
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1