This is a migrated thread and some comments may be shown as answers.

Validation not working on Upload Kendo control

1 Answer 247 Views
Upload
This is a migrated thread and some comments may be shown as answers.
swarnamala
Top achievements
Rank 1
swarnamala asked on 24 Jul 2014, 08:18 PM
Here is a screen shot of my all. Validation are not working on Kendo Upload control used.



View has code:


 <div class="col-md-4">
                    @Html.Label("file", "Select File")
                    @(Html.Kendo().Upload()
                          .Name("upload")
                          .Multiple(false)
                          .Messages(msgs => msgs.Select("Browse"))
                          )
                   @Html.ValidationHtmlMessageFor(model => model.UploadFileName)
                </div>
                <div class="col-md-4 buttonBox">
                    @Html.Kendo().Button().Name("Save").Content("Upload File").HtmlAttributes(new {type = "submit"}) 

Code in View Model:

    [Required(ErrorMessageResourceType = typeof(Resources.Resources),
                  ErrorMessageResourceName = "FieldRequired")]
        [Display(Name = "Month")]
        public int ObjectiveMonth { get; set; }


Controller checks for ModelState.isValid

But the validation message do not show up

What could the reason be?

















1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 25 Jul 2014, 10:32 AM
Hello Swarnamala,


The unobtrusive validation is not supported out of the box by the Kendo UI Upload widget. Nevertheless you could use the Kendo UI Validator and define a custom validation rule as demonstrated in the following topic.

Regards,
Dimiter Madjarov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Upload
Asked by
swarnamala
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or