472,951 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 software developers and data experts.

Accessing a drop down in a form view from a user control

Main page has a FormView, and within that, is a drop down.

A user control is on the page
>From the user control, I need access to the drop down value. I can get
to it like this

Dim cc As FormView, dd As DropDownList

cc = Parent.FindControl("FormView1")
dd = cc.FindControl("currency_code")

exchange_rate.Text = dd.SelectedValue

Is there a more direct route?

Dec 20 '06 #1
4 1261
"Larry Bud" <la**********@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
Main page has a FormView, and within that, is a drop down.

A user control is on the page
>>From the user control, I need access to the drop down value. I can get
to it like this

Dim cc As FormView, dd As DropDownList

cc = Parent.FindControl("FormView1")
dd = cc.FindControl("currency_code")

exchange_rate.Text = dd.SelectedValue

Is there a more direct route?
Have you tried

exchange_rate.Text = currency_code.SelectedValue

?
Dec 20 '06 #2

Mark Rae wrote:
"Larry Bud" <la**********@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
Main page has a FormView, and within that, is a drop down.

A user control is on the page
>From the user control, I need access to the drop down value. I can get
to it like this

Dim cc As FormView, dd As DropDownList

cc = Parent.FindControl("FormView1")
dd = cc.FindControl("currency_code")

exchange_rate.Text = dd.SelectedValue

Is there a more direct route?

Have you tried

exchange_rate.Text = currency_code.SelectedValue
Yes, I have. Compilation error, "currency_code not declared."

Dec 20 '06 #3

Mark Rae wrote:
"Larry Bud" <la**********@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegro ups.com...
Main page has a FormView, and within that, is a drop down.

A user control is on the page
>From the user control, I need access to the drop down value. I can get
to it like this

Dim cc As FormView, dd As DropDownList

cc = Parent.FindControl("FormView1")
dd = cc.FindControl("currency_code")

exchange_rate.Text = dd.SelectedValue

Is there a more direct route?

Have you tried

exchange_rate.Text = currency_code.SelectedValue
Yes, I have. Compilation error, "currency_code not declared."

Dec 20 '06 #4
"Larry Bud" <la**********@yahoo.comwrote in message
news:11*********************@t46g2000cwa.googlegro ups.com...
Mark Rae wrote:
>"Larry Bud" <la**********@yahoo.comwrote in message
news:11**********************@f1g2000cwa.googlegr oups.com...
Main page has a FormView, and within that, is a drop down.

A user control is on the page

From the user control, I need access to the drop down value. I can get
to it like this

Dim cc As FormView, dd As DropDownList

cc = Parent.FindControl("FormView1")
dd = cc.FindControl("currency_code")

exchange_rate.Text = dd.SelectedValue

Is there a more direct route?

Have you tried

exchange_rate.Text = currency_code.SelectedValue

Yes, I have. Compilation error, "currency_code not declared."
OK then - have you tried prefixing currency_code.SelectedValue with the id
of the custom control...?
Dec 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dec | last post by:
Ok to simplify things I'll just give an example. This is pretty much what I want to do (minus the postcode): http://www.perrys.co.uk/usedcar?ID=F5J9BNNBMVK00DF I have relatively little...
1
by: George Durzi | last post by:
I have a JavaScript called common.js that is referenced by every ASPX in my web application. In common.js, I have a funtion called findText (which I use to help me navigate through drop down lists...
2
by: Eric Dan | last post by:
Hi, Even tough I was able to implement what I want in a weird and non efficient way, I would like to get an opinion what is the right way to achieve my task: Scenario: • Display a DataGrid...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
3
by: John Walker | last post by:
Hi, On an ASP.NET page I have a drop down list control. When the user pulls down the list and makes a selection, I perform validation, and if the validation fails I want the selected item in...
3
by: CSharpguy | last post by:
I have 3 drop downs that are populated from the databasem 4 of my web pages need to have this drop down, how can I trap the selection made in the drop down and popuate my grid on my form?
6
by: John | last post by:
I have a drop down on my form and I need all the values in that drop down and pass to a stored procedure, how can I get the values of the drop down and pass them all to my stored procedure call?
1
by: AndiSmith | last post by:
Hi guys, I wondered if anyone could help me with this problem, or even shed some light on the direction I need to take to resolve it? I'm using .NET 2.0 (C# flavor) to build a large user-based...
4
by: magmike | last post by:
I've got a control on my form that allows the user to select a record based on a form field (in this example, the drop down menu shows the company name, followed by the contact name but uses the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.