Programmatically disable/hid Submit Button 
Author Message
 Programmatically disable/hid Submit Button

Does anybody know of a way to programmatically
hide/disable a button.  I have a form that, after
submitted, displays results in a datagrid.  I would like
to, at that point, disable the submit button so they do
not resubmit the page.   I have tried both the following
lines,

this.btnAddEcn.Visible = "False";
this.btnAddEcn.Enabled = "False";

...but get this error during compilation

CS0029: Cannot implicitly convert type 'string' to 'bool'

Any ideas?

Thanks.



Sun, 12 Dec 2004 02:15:29 GMT  
 Programmatically disable/hid Submit Button
Scott,

    Try it like this, without the brackets:

this.btnAddEcn.Visible = false;
this.btnAddEcn.Enabled = false;

    You can not implicitly convert between a string and boolean type in C#.

    Hope this helps.

--
               - Nicholas Paldino [.NET MVP]


Quote:
> Does anybody know of a way to programmatically
> hide/disable a button.  I have a form that, after
> submitted, displays results in a datagrid.  I would like
> to, at that point, disable the submit button so they do
> not resubmit the page.   I have tried both the following
> lines,

> this.btnAddEcn.Visible = "False";
> this.btnAddEcn.Enabled = "False";

> ...but get this error during compilation

> CS0029: Cannot implicitly convert type 'string' to 'bool'

> Any ideas?

> Thanks.



Sun, 12 Dec 2004 02:16:45 GMT  
 Programmatically disable/hid Submit Button

nothing wrong, show yur full code. Do you trying to use this in web app?

S. A. Hasnut
MCSD, CIW A
It Magnet
http://itmagnet.com.au

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sun, 12 Dec 2004 03:24:53 GMT  
 Programmatically disable/hid Submit Button
That was it.  I had tried that before, but typed
in "False" instead of "false".

Thanks.

Quote:
>-----Original Message-----
>Scott,

>    Try it like this, without the brackets:

>this.btnAddEcn.Visible = false;
>this.btnAddEcn.Enabled = false;

>    You can not implicitly convert between a string and
boolean type in C#.

>    Hope this helps.

>--
>               - Nicholas Paldino [.NET MVP]



>> Does anybody know of a way to programmatically
>> hide/disable a button.  I have a form that, after
>> submitted, displays results in a datagrid.  I would like
>> to, at that point, disable the submit button so they do
>> not resubmit the page.   I have tried both the following
>> lines,

>> this.btnAddEcn.Visible = "False";
>> this.btnAddEcn.Enabled = "False";

>> ...but get this error during compilation

>> CS0029: Cannot implicitly convert type 'string'
to 'bool'

>> Any ideas?

>> Thanks.

>.



Sun, 12 Dec 2004 03:29:34 GMT  
 Programmatically disable/hid Submit Button
Well, at least you typed it right. I usually spell it
"flase"

-c


Quote:
> That was it.  I had tried that before, but typed
> in "False" instead of "false".

> Thanks.

> >-----Original Message-----
> >Scott,

> >    Try it like this, without the brackets:

> >this.btnAddEcn.Visible = false;
> >this.btnAddEcn.Enabled = false;

> >    You can not implicitly convert between a string and
> boolean type in C#.

> >    Hope this helps.

> >--
> >               - Nicholas Paldino [.NET MVP]



> >> Does anybody know of a way to programmatically
> >> hide/disable a button.  I have a form that, after
> >> submitted, displays results in a datagrid.  I would like
> >> to, at that point, disable the submit button so they do
> >> not resubmit the page.   I have tried both the following
> >> lines,

> >> this.btnAddEcn.Visible = "False";
> >> this.btnAddEcn.Enabled = "False";

> >> ...but get this error during compilation

> >> CS0029: Cannot implicitly convert type 'string'
> to 'bool'

> >> Any ideas?

> >> Thanks.

> >.



Sun, 12 Dec 2004 03:32:32 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Hiding or disabling close button (X) in floating toolbar

2. CHtmlView and trapping the Submit button click

3. Cannot hide a floating toolbar using Hide button

4. How does one programmatically show/hide CToolBars

5. Hide Taskbar Programmatically Pt. II

6. Tough: Hide TaskBar Programmatically

7. how:hide CListCtrl scroll bar and scroll programmatically

8. MSVC 1.52 button disable with owner draw buttons

9. Icons disappear from buttons in Windows 98 when the button is disabled

10. Programmatically Disable Device in Windows95

11. Disable programmatically System Restore - XP

12. Determine programmatically shortcut key for dialog button

 

 
Powered by phpBB® Forum Software