Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Accessing a drop down in a form view from a user control

Reply
Thread Tools

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

 
 
Larry Bud
Guest
Posts: n/a
 
      12-20-2006
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?

 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      12-20-2006
"Larry Bud" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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

?


 
Reply With Quote
 
 
 
 
Larry Bud
Guest
Posts: n/a
 
      12-20-2006

Mark Rae wrote:
> "Larry Bud" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) 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."

 
Reply With Quote
 
Larry Bud
Guest
Posts: n/a
 
      12-20-2006

Mark Rae wrote:
> "Larry Bud" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) 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."

 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      12-20-2006
"Larry Bud" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...

> Mark Rae wrote:
>> "Larry Bud" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) 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."


OK then - have you tried prefixing currency_code.SelectedValue with the id
of the custom control...?


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Affecting a dynamically created drop down from another dynamically created drop down. msimmons ASP .Net 0 07-16-2009 03:17 PM
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
Multiple select drop down poplulating sub drop down scott@dettcom.com Javascript 3 11-09-2006 07:50 PM
Auto Drop down a Drop Down List xxbmichae1@supergambler.com Javascript 5 11-23-2005 01:35 AM
New to .NET, can I have one drop down box control the data of another drop down box using a database? SirPoonga ASP .Net 2 01-07-2005 10:44 PM



Advertisments