468,277 Members | 1,460 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,277 developers. It's quick & easy.

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 1173
"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by George Durzi | last post: by
5 posts views Thread by Vigneshwar Pilli via DotNetMonster.com | last post: by
3 posts views Thread by John Walker | last post: by
3 posts views Thread by CSharpguy | last post: by
6 posts views Thread by John | last post: by
4 posts views Thread by magmike | last post: by
1 post views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.