passing form in a module and access its controls in asp.net

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I need to pass a form say 'webform1' in a class file myClass (.vb)
and access its web controls say 'txtdisp', .....

My code snippet is :

Imports System.Web.UI
public class myClass

public sub disableitems(ByRef frm as WebForm1)
'Here my intention is to set enabled property of txtdisp to false
'And this control is in WebForm1.
'The below code is not working for me.
frm.txtdisp.enabled = false
end sub

end class
 
Hi,

If all you want is to set the enabled property or some other property, then
you might consider using the DynamicProperties from the Properties list.

Senthil
 
Back
Top