|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
control disablehi, how to disable the controls in page? thanks
For each myControl in Page.Controls 'want to disable myControl? Next j*@someone.com wrote:
> hi, how to disable the controls in page? thanks For each myControl in Page.Controls> > For each myControl in Page.Controls > 'want to disable myControl? > Next > > 'want to disable myControl? myControl.Enabled = False Next Hi,
I got compile error: "Enable" is not a membre of "System.Web.UI.Control", Dim myControl as Control For each myControl in Page.Controls 'want to disable myControl? myControl.Enabled = False Next How to fix it? Thanks. Show quoteHide quote "Chris" <no@spam.com> wrote in message news:eq5AJIGMGHA.2316@TK2MSFTNGP11.phx.gbl... > j*@someone.com wrote: >> hi, how to disable the controls in page? thanks >> >> For each myControl in Page.Controls >> 'want to disable myControl? >> Next > > For each myControl in Page.Controls > 'want to disable myControl? > myControl.Enabled = False > Next Hi Js,
Instead of declaring myControl as Control, try declaring it as WebControl (System.Web.UI.WebControls.WebControl). This class possesses the "Enabled" property. This of course, assumes that you have only WebControls on your page, and not HtmlControls etc. Also, not all WebControls support this property, so you would have to be careful about what all you have on the page. An alternative may be to put all the controls you want to disable, into a Panel control and then use "For each myControl in Panel1.Controls".. The code would then be : ------------------------ Dim myControl as WebControl For each myControl in Page.Controls myControl.Enabled = False Next ------------------------ Hope this helps... Regards, Cerebrus. Show quoteHide quote "js" <j*@someone.com> wrote in message news:OksqowKMGHA.552@TK2MSFTNGP10.phx.gbl... > Hi, > I got compile error: "Enable" is not a membre of "System.Web.UI.Control", > > Dim myControl as Control > For each myControl in Page.Controls > 'want to disable myControl? > myControl.Enabled = False > Next > > How to fix it? Thanks. > > "Chris" <no@spam.com> wrote in message > news:eq5AJIGMGHA.2316@TK2MSFTNGP11.phx.gbl... > > j*@someone.com wrote: > >> hi, how to disable the controls in page? thanks > >> > >> For each myControl in Page.Controls > >> 'want to disable myControl? > >> Next > > > > For each myControl in Page.Controls > > 'want to disable myControl? > > myControl.Enabled = False > > Next > > js,
Have a look at the uper part of this sample. http://www.vb-tips.com/default.aspx?ID=8ff290d4-5c16-4cef-ba06-56e3599238c1 and than instead of that addhanlder ctr.enabled = false However in this is probably me.enabled = false easier. Cor Js,
I see now that it is a webform, that is this tip. http://www.vb-tips.com/default.aspx?ID=0e966f46-0381-4cec-82e8-ec5d24c916a6 And than the same as I wrote in the previous message. Sorry, I did not see it direct, I hope this helps, Cor Thanks Cor.
Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:uema1HNMGHA.536@TK2MSFTNGP09.phx.gbl... > Js, > > I see now that it is a webform, that is this tip. > > http://www.vb-tips.com/default.aspx?ID=0e966f46-0381-4cec-82e8-ec5d24c916a6 > > And than the same as I wrote in the previous message. > > Sorry, I did not see it direct, > > I hope this helps, > > Cor >
Local Machine policy exceptions
VB.NET or C#.NET ??? Is there a difference between passing "" and passing Nothing to a Windows API ? TCP/IP Socket communication from multiple clients reading text files byref and byvalue Open a text file and into an array ?? Help to Italy Must I change the property in 26 projects or is there a soultion level way of doing it Usual Databinding Question - UNusual Requirements |
|||||||||||||||||||||||