|
 |
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 .
|
 |
|
|
 |
|

October 9th, 2006, 05:27 PM
|
Registered User
|
|
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

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
|
|
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
|

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
|
|
... 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
|

October 10th, 2006, 02:25 PM
|
Registered User
|
|
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

October 11th, 2006, 12:07 PM
|
Registered User
|
|
Join Date: Oct 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Rit
I placed the dropdown list inside the formview and it is working now.
Thanks for guiding
Amit
|

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
|
|
Thats no problem. Sorry I didn't get back to you earlier.. A little manic here!
Rit
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |