PC Review


Reply
Thread Tools Rate Thread

How to return a radiobuttonlist control in fromview control

 
 
snow
Guest
Posts: n/a
 
      17th May 2011
Hi All,

Here is my code:

Dim r As RadioButtonList
r = CType(anFormView.FindControl("RadioButtonList1"), RadioButtonList)

when I debug the code, r is nothing. What am I doing wrong?
RadioButtonList1 is the control ID.

Thanks for the help!
 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      18th May 2011
Are you sure that the anFromView exist when you use this code?

That is not always the case in a page form

Simple debugging and placing your cursor on the anFormView as it breaks on
the breakpoint behind that, makes this probably direct clear.

Cor

"snow" wrote in message
news:55e5f6da-0d86-4904-b485-(E-Mail Removed)...

Hi All,

Here is my code:

Dim r As RadioButtonList
r = CType(anFormView.FindControl("RadioButtonList1"), RadioButtonList)

when I debug the code, r is nothing. What am I doing wrong?
RadioButtonList1 is the control ID.

Thanks for the help!

 
Reply With Quote
 
 
 
 
snow
Guest
Posts: n/a
 
      25th May 2011
I get the radiobuttonlist return, but when I set it is visible or
invisible, it is not updated.

for example,
Dim r As Button = FormView1.FindControl("RadioButtonList1")
if case1 = true then
r.visible = true
else
r.visible = false
end if

The code seems good, but when run the program, the radiobuttonlist
control does not make a change. Why?


On May 18, 9:32*am, "Cor" <n...@none.non> wrote:
> Are you sure that the anFromView exist when you use this code?
>
> That is not always the case in a page form
>
> Simple debugging and placing your cursor on the anFormView as it breaks on
> the breakpoint behind that, makes this probably direct clear.
>
> Cor
>
> "snow" *wrote in message
>
> news:55e5f6da-0d86-4904-b485-(E-Mail Removed)...
>
> Hi All,
>
> Here is my code:
>
> Dim r As RadioButtonList
> r = CType(anFormView.FindControl("RadioButtonList1"), RadioButtonList)
>
> when I debug the code, r is nothing. What am I doing wrong?
> RadioButtonList1 is the control ID.
>
> Thanks for the help!


 
Reply With Quote
 
snow
Guest
Posts: n/a
 
      25th May 2011
Sorry, it should be a radiobuttonlist in the code.

I get the radiobuttonlist return, but when I set it is visible or
> invisible, it is not updated.
>
> for example,
> Dim r As RadioButtonList = FormView1.FindControl("RadioButtonList1")
> if case1 = true then
> r.visible = true
> else
> r.visible = false
> end if



On May 25, 3:52*pm, snow <barbara_d...@yahoo.com> wrote:
> *I get the radiobuttonlist return, but when I set it is visible or
> invisible, it is not updated.
>
> for example,
> Dim r As Button = FormView1.FindControl("RadioButtonList1")
> *if case1 = true then
> * * * * *r.visible = true
> else
> * * * * r.visible = false
> end if
>
> The code seems good, but when run the program, the radiobuttonlist
> control does not make a change. Why?
>
> On May 18, 9:32*am, "Cor" <n...@none.non> wrote:
>
>
>
> > Are you sure that the anFromView exist when you use this code?

>
> > That is not always the case in a page form

>
> > Simple debugging and placing your cursor on the anFormView as it breakson
> > the breakpoint behind that, makes this probably direct clear.

>
> > Cor

>
> > "snow" *wrote in message

>
> >news:55e5f6da-0d86-4904-b485-(E-Mail Removed)...

>
> > Hi All,

>
> > Here is my code:

>
> > Dim r As RadioButtonList
> > r = CType(anFormView.FindControl("RadioButtonList1"), RadioButtonList)

>
> > when I debug the code, r is nothing. What am I doing wrong?
> > RadioButtonList1 is the control ID.

>
> > Thanks for the help!- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Add onclick javascript code to each radio button in a RadioButtonList control Ryan Taylor Microsoft ASP .NET 0 11th Nov 2004 06:14 PM
RadioButtonList in Repeater Control...Ouch Darren Microsoft ASP .NET 1 28th Sep 2004 07:10 PM
Handling Radiobuttonlist event inside Repeater Control Ravi Microsoft ASP .NET 1 8th May 2004 03:48 AM
adding radiobuttonlist within a datalist control ani Microsoft ASP .NET 0 7th Nov 2003 03:46 PM
adding radiobuttonlist within a datalist control ani Microsoft ASP .NET 0 7th Nov 2003 12:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:53 AM.