-
Mar 22nd, 2022, 08:47 AM
#1
Thread Starter
New Member
Overriding CSS Class for Texbox with enabled='false'
i am using Visual Studio 2019 with ASP.NET Framework 7.2,
when i use textbox with enabled=”false” in my HTML during test Web page i found added code:
disabled=”disabled” and class=”aspNetDisabled”
in my HTML, this code override my css class code.
I try to use WebControl.DisabledCssClass = “mycss” in vb.net code and also in Global.asax file,
but during ReBuild code from VS2019 i receive this message:
error BC30456: ‘DisabledCssClass’ is not member of ‘System.Web.UI.WebControls.WebControl’.
i have used Add Reference for “System.web.dll” but the error occur too.
what can i do? THANKS very much!
-
Mar 24th, 2022, 06:03 AM
#2
Re: Overriding CSS Class for Texbox with enabled='false'
Its not clear exactly what your trying to do, but..
If you just want your control to always be enabled why dont you just change your view and remove the disabled and class elements ?
If you want to change whether a textbox is enabled or disabled depending on conditions then you probably want to that using JavaScript !
If its something else then you need to tell us what your trying to achieve ?
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Mar 24th, 2022, 09:58 AM
#3
Thread Starter
New Member
Re: Overriding CSS Class for Texbox with enabled='false'
I would simply like that for disabled textboxes my class defined in the html code was used, instead that class is replaced with an aspNetDisabled class when viewing the web page and that changes the font of the textbox and its size
I tried to use the command WebControl.DisabledCssClass = "myclass" to force my CSS class but during the build of the website I get the error that DisabledCssClass is not a member of System.Web.UI.WebControls.Webcontrol
-
Mar 28th, 2022, 04:55 AM
#4
Re: Overriding CSS Class for Texbox with enabled='false'
disabled=”disabled” and class=”aspNetDisabled”
you should just be able to edit your view directly and add a class to your textbox.
Can you post your textbox code from you view so I can see what your doing?
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|