English 中文(简体)
如何使变压器有色红吗?
原标题:how can i make Valdator s color red?
  • 时间:2012-01-16 06:05:34
  •  标签:
  • asp.net

i have a problem that i have specified the color of RequiredFieldValidator to red but when i publish the website on net the color of RequiredFieldValidator is changed to black. it works fine in localhost. what could be the problem ? thanks in advance..

“这是一想”/。</p

最佳回答

By default the validator is red - you shouldn t need to change it. Check your css to make sure it is not getting over ridden by anything. Also check the class that the requiredfieldvalidator is set to and make sure it does not include a color property.

问题回答

Rohan,

这可能是你的问题。 我有同样的问题。

否则,框架4.0将使所有验证人错误信息黑白。 如果你把框架定为4,那么你就需要明确确定所有有效人员的代办。

Your source output in 3.5:

<span id="ctl01_YourControl" style="color:Red;visibility:hidden;">*</span>

页: 1

<span id="ctl01_YourControl" style="visibility:hidden;">*</span>

ASP.NET 4.0对清洁生产法进行了修改,其中包括:

xhtmlConformance is set to Strict. Menus are rendered as lists rather than tables Extraneous properties like border=0 are removed from the emitted markup. Even the error text on validation controls is no longer set to red. The rendering of the outer table for templated controls can now be controlled with the newRenderOuterTable property. For compatibility, you can make your output look the same as it did in ASP.NET 3.5 with the controlRenderingCompatibilityVersion

> <?xml version="1.0"?> <configuration>   <system.web>
>     <compilation debug="false" targetFramework="4.0" />
>     <pages controlRenderingCompatibilityVersion="3.5" />   </system.web> </configuration>

可在http://msdn.microsoft.com/en-us/library/system.web.ui. Control.renderingcompatibility.aspx 查询。

我非常高兴地解决这个问题。 我感到惊讶的是,我找不到更多人来回答这一问题。 我认为,在我的案件中,采用这种兼容性办法,或将我的所有验证控制委托给Red。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签