This question is locked. New answers and comments are not allowed.
Hello
I have installed the MVC 3 package from Microsoft and work with the Razor view engine.
When I try to use the latest TimePicker in my project I cannot get it to validate on the client. The other properties of my model (strings) are correctly validated.
In my Layout page (masterpage) I use the following 2 script files in the head section (I'm combining Telerik with jQuery UI)
<script src="../../Scripts/2010.3.1110/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.6.min.js" type="text/javascript"></script>
At the end of the page I use the Telerik ScriptRegistrar as follows:
@(Html.Telerik().ScriptRegistrar()
.jQuery(false)
.DefaultGroup(group => group
.Add("jquery.validate.js")
.Add("jquery.validate.unobtrusive.js")
)
)
On my content page I use the following directives:
@model StockMgmt.Models.Person
@using Telerik.Web.Mvc.UI
afterwards I use a form with the following test values
@using (Html.BeginForm())
{
<table>
<tr>
<td>@Html.LabelFor(m => m.Lastname)</td>
<td>@Html.TextBoxFor(m => m.Lastname)</td>
<td>@Html.ValidationMessageFor(m => m.Lastname)</td>
</tr>
<tr>
<td>@Html.LabelFor(m => m.TimeModel)</td>
<td>@Html.Telerik().TimePickerFor(m => m.TimeModel)</td>
<td>@Html.ValidationMessageFor(x => x.TimeModel)</td>
</tr>
</table>
<button type="submit">Submit Form</button>
}
The Lastname property does give me the correct validation message, but the TimeModel property does not...
This is how my TimeModel property looks like in the Model class
[DataType(DataType.Time)]
[Required(ErrorMessage = "REQUIRED")]
public DateTime? TimeModel{ get; set; }
Any help is welcome because I really want to continue to use MVC 3, razor and the Telerik extensions!
Thank you
Gerrie
I have installed the MVC 3 package from Microsoft and work with the Razor view engine.
When I try to use the latest TimePicker in my project I cannot get it to validate on the client. The other properties of my model (strings) are correctly validated.
In my Layout page (masterpage) I use the following 2 script files in the head section (I'm combining Telerik with jQuery UI)
<script src="../../Scripts/2010.3.1110/jquery-1.4.3.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.6.min.js" type="text/javascript"></script>
At the end of the page I use the Telerik ScriptRegistrar as follows:
@(Html.Telerik().ScriptRegistrar()
.jQuery(false)
.DefaultGroup(group => group
.Add("jquery.validate.js")
.Add("jquery.validate.unobtrusive.js")
)
)
On my content page I use the following directives:
@model StockMgmt.Models.Person
@using Telerik.Web.Mvc.UI
afterwards I use a form with the following test values
@using (Html.BeginForm())
{
<table>
<tr>
<td>@Html.LabelFor(m => m.Lastname)</td>
<td>@Html.TextBoxFor(m => m.Lastname)</td>
<td>@Html.ValidationMessageFor(m => m.Lastname)</td>
</tr>
<tr>
<td>@Html.LabelFor(m => m.TimeModel)</td>
<td>@Html.Telerik().TimePickerFor(m => m.TimeModel)</td>
<td>@Html.ValidationMessageFor(x => x.TimeModel)</td>
</tr>
</table>
<button type="submit">Submit Form</button>
}
The Lastname property does give me the correct validation message, but the TimeModel property does not...
This is how my TimeModel property looks like in the Model class
[DataType(DataType.Time)]
[Required(ErrorMessage = "REQUIRED")]
public DateTime? TimeModel{ get; set; }
Any help is welcome because I really want to continue to use MVC 3, razor and the Telerik extensions!
Thank you
Gerrie