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

  • Thread starter Thread starter Larry Bud
  • Start date Start date
L

Larry Bud

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?
 
Main page has a FormView, and within that, is a drop down.

A user control is on the page

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...?
 
Back
Top