How to return a radiobuttonlist control in fromview control

  • Thread starter Thread starter snow
  • Start date Start date
S

snow

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!
 
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

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!
 
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?
 
Sorry, it should be a radiobuttonlist in the code.

I get the radiobuttonlist return, but when I set it is visible or
 
Back
Top