Razor 删除内联样式的默认Html.textbox

Razor 删除内联样式的默认Html.textbox,razor,asp.net-mvc-4,html-helper,inline-styles,Razor,Asp.net Mvc 4,Html Helper,Inline Styles,我有一个非常基本的表单,我使用模型从视图渲染它。 在此表单中,我有如下som文本输入: <div class="editor-label"> @Html.LabelFor(model => model.UserProfile.FirstName) </div> <div class="editor-field"> @Html.TextBoxFor(model => model.UserProfile.FirstName)

我有一个非常基本的表单,我使用模型从视图渲染它。 在此表单中,我有如下som文本输入:

<div class="editor-label">
     @Html.LabelFor(model => model.UserProfile.FirstName)
</div>
<div class="editor-field">
     @Html.TextBoxFor(model => model.UserProfile.FirstName)
     @Html.ValidationMessageFor(model => model.UserProfile.FirstName)
</div>
和类似,但我添加的内联样式是在我要删除的样式之前添加的,因此它们会被覆盖


如何删除或覆盖此内联样式?

我认为这不是TextBoxFor helper的默认行为。您在页面上有运行jQuery插件吗?尤其是一个可能注入像这样的内联样式的样式?

我认为这不是TextBoxFor helper的默认行为。您在页面上有运行jQuery插件吗?尤其是一款可能会注入这种内联风格的产品?

是的,过了一会儿,我也想到了这个问题。我在网站上有jquery1.8.3(jquery、jqueryui、jquery.unobtrusive和jquery.validate)和现代化工具。我试图从站点中删除jquery.validate,但它消失了。但是我不想不使用jquery.validate。但我想这是另一篇文章的问题。至少我找到了罪犯。谢谢,真奇怪。我以前没有见过jquery.validate这样做。我认为它与jQuery有关,因为HtmlHelper的源代码没有应用任何样式属性。是的,过了一段时间我也想到了这个问题。我在网站上有jquery1.8.3(jquery、jqueryui、jquery.unobtrusive和jquery.validate)和现代化工具。我试图从站点中删除jquery.validate,但它消失了。但是我不想不使用jquery.validate。但我想这是另一篇文章的问题。至少我找到了罪犯。谢谢,真奇怪。我以前没有见过jquery.validate这样做。我认为它与jQuery相关,因为HtmlHelper的源代码没有应用任何样式属性。
<input 
id="UserProfile_FirstName" 
name="UserProfile.FirstName" 
type="text" 
value="xxx"
sourceindex="4" 
style="border-style: solid; border-width: 1px; 
    border-color: rgb(238, 50, 50) rgb(240, 80, 80) rgb(240, 80, 80); 
    box-shadow: rgb(250, 230, 230) 1px 1px inset; 
    -webkit-box-shadow: rgb(250, 230, 230) 1px 1px inset;">
@Html.TextBoxFor(model => model.UserProfile.LastName, null, 
{ @style = "border-width: 0px;" })