English 中文(简体)
Telerik MVC Combo 箱确认:改变无效价值错误信息
原标题:Telerik MVC Combobox validation: change invalid value error message
@(Html.Telerik().ComboBoxFor( x => x.SelectedFoo )
    .DataBinding( x => x.Ajax().Select( "_List", "Foo" ) )
    .AutoFill( true )
    .HighlightFirstMatch( true )
    .Filterable( x => x.FilterMode( AutoCompleteFilterMode.StartsWith ) )
)
@Html.ValidationMessageFor( x => x.SelectedFoo )

Alright, so Im using Telerik s combo Box part for ASP. NET MVC, and I can t que where to set/change ( also localize) the有误值的电文。

缺省错误信息是

被遗忘的价值不适用于某些Foo

之所以出现这一错误,是因为asd”不是加油箱允许的一套数值的一部分。

我愿尽可能利用数据发布。

这是我目前拥有的:

[Required( ErrorMessageResourceType = typeof( Resources.ErrorStrings ),
    ErrorMessageResourceName = "Required_SelectedFoo" )]
public Guid? SelectedFoo { get; set; }
最佳回答

这一点是不容的,但可以解释。 选 选 Foo是打字式的GUID。 当框架试图将古董的等级划分为一类时,它就会放弃和例外,而这种例外又加诸于模范语词典,而这一切都发生在援引验证特征之前。 因此,在这种情况下,你可能不会改变其容易和可行的方式。 然而,你可以做的是改变你这样的模式。

 [Required( ErrorMessageResourceType = typeof( Resources.ErrorStrings ),    ErrorMessageResourceName = "Required_SelectedFoo" )]
[RegularExpression("ExpressionforGUID")]
public string StringSelectedFoo { get; set; }
public GUID SelectedFoo{get{return (GUID)StringSelectedFoo;}}//have to do some sanitation work here

并且认为,你创立了“自主”或“一切”来取代“选择Foo”

问题回答

你做了一切。

www.un.org/Depts/DGACM/index_spanish.htm 但是,如果无效值与<代码>相联,则的确认有效>。

There is nothing wrong with Required you need to but something like RegularExpression validation attribute or something else to get the right validation message.





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

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 (...

热门标签