Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old October 9th, 2006, 05:27 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the code below value in the textbox is not being set.
Can you give a solution.

Dim t As TextBox
        Dim selectedValue As String = DropDownList2.SelectedValue
        t = Me.FormView1.Row.FindControl("TextBox1")
        t.Text = selectedValue


Reply With Quote
  #12 (permalink)  
Old October 10th, 2006, 05:55 AM
Friend of Wrox
 
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

HI Amit2604

I think the problem is that u need to use FindControl for DropdownList2 before assigning it to selectedValue.. thats if it is within Formview1 too:

Dim t As TextBox
        Dim selectedValue As DropDownList = FormView1.FindControl("DropDownList2")
        t = Me.FormView1.Row.FindControl("TextBox1")
        t.Text = selectedValue.SelectedValue

Rit
Reply With Quote
  #13 (permalink)  
Old October 10th, 2006, 06:03 AM
Friend of Wrox
 
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

... also notice the declaration of selectedValue being DropdownList instead of String.

Dim selectedValue As DropDownList = FormView1.FindControl("DropDownList2")

..And the way it is being used in the last line

 t.Text = selectedValue.SelectedValue
Reply With Quote
  #14 (permalink)  
Old October 10th, 2006, 02:25 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rit
Thanks for responding.
But my dropdownlist list is not inside FormView.
I can simply get the value from dropdownlist2.SelectedValue.
This value I am trying to assign to one of the textbox in FormView.


Amit

Reply With Quote
  #15 (permalink)  
Old October 11th, 2006, 12:07 PM
Registered User
 
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Rit
I placed the dropdown list inside the formview and it is working now.

Thanks for guiding
Amit

Reply With Quote
  #16 (permalink)  
Old October 11th, 2006, 02:33 PM
Friend of Wrox
 
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

Thats no problem. Sorry I didn't get back to you earlier.. A little manic here!

Rit
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

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
max length property of multiline text box MunishBhatia ASP.NET 2.0 Professional 5 June 14th, 2007 01:55 AM
Text Box .text Property Displays conflicting Valus JPOhlman Visual Basic 2005 Basics 3 August 23rd, 2006 02:39 PM
text-property in a non-server control propellis .NET Web Services 0 July 4th, 2006 03:29 AM
Can't set text property of dynamic text box sreerajrs ASP.NET 1.0 and 1.1 Professional 1 May 31st, 2006 09:39 PM
User Control Name in a Text Property laslanid Pro VB.NET 2002/2003 0 February 24th, 2005 04:31 AM



All times are GMT -4. The time now is 10:11 AM.


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