I upgrade my kendo UI for MVC to 2014.1.415
I want to add rule to the masked text box. So I copied the example from this page:
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/maskedtextbox/overview
Here is my view:
--------------------
@{
ViewBag.Title = "MaskedTextWithRule";
}
<h2>MaskedTextWithRule</h2>
<div class="demo-section">
<h2>Mask Input </h2>
<ul id="fieldlist">
<li>
<label for="phone_number">Phone number:</label>
@(Html.Kendo().MaskedTextBox()
.Name("phone_number")
.Mask("(999) 000-0000")
.Value("555 123 4567")
)
</li>
<li>
@(Html.Kendo().MaskedTextBox()
.Name("maskedtextbox")
.Rules(rules => {
rules.Add("~", "/[+-]/");
})
.Mask("~0000") //Set a mask with custom rule
)
</li>
</ul>
</div>
<style>
.demo-section {
width: 300px;
margin: 35px auto 50px;
padding: 30px;
}
.demo-section h2 {
text-transform: uppercase;
font-size: 1.2em;
margin-bottom: 10px;
}
#fieldlist
{
margin:0;
padding:0;
}
#fieldlist li
{
list-style:none;
padding:10px 0;
}
#fieldlist label {
display: inline-block;
width: 130px;
margin-right: 5px;
text-align: right;
}
</style>
---------------------------------------------------
I compiled the project without problem, but when I run it, I got the following error
--------------------------------------------
Server Error in '/' Application.Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1502: The best overloaded method match for 'Kendo.Mvc.UI.Fluent.MaskedTextBoxRulesBuilder.Add(char, string)' has some invalid arguments
Source Error:
Line 22: .Name("maskedtextbox")
Line 23: .Rules(rules => {
Line 24: rules.Add("~", "/[+-]/");
Line 25: })
Line 26: .Mask("~0000") //Set a mask with custom rule
I want to add rule to the masked text box. So I copied the example from this page:
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/maskedtextbox/overview
Here is my view:
--------------------
@{
ViewBag.Title = "MaskedTextWithRule";
}
<h2>MaskedTextWithRule</h2>
<div class="demo-section">
<h2>Mask Input </h2>
<ul id="fieldlist">
<li>
<label for="phone_number">Phone number:</label>
@(Html.Kendo().MaskedTextBox()
.Name("phone_number")
.Mask("(999) 000-0000")
.Value("555 123 4567")
)
</li>
<li>
@(Html.Kendo().MaskedTextBox()
.Name("maskedtextbox")
.Rules(rules => {
rules.Add("~", "/[+-]/");
})
.Mask("~0000") //Set a mask with custom rule
)
</li>
</ul>
</div>
<style>
.demo-section {
width: 300px;
margin: 35px auto 50px;
padding: 30px;
}
.demo-section h2 {
text-transform: uppercase;
font-size: 1.2em;
margin-bottom: 10px;
}
#fieldlist
{
margin:0;
padding:0;
}
#fieldlist li
{
list-style:none;
padding:10px 0;
}
#fieldlist label {
display: inline-block;
width: 130px;
margin-right: 5px;
text-align: right;
}
</style>
---------------------------------------------------
I compiled the project without problem, but when I run it, I got the following error
--------------------------------------------
Server Error in '/' Application.Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1502: The best overloaded method match for 'Kendo.Mvc.UI.Fluent.MaskedTextBoxRulesBuilder.Add(char, string)' has some invalid arguments
Source Error:
Line 22: .Name("maskedtextbox")
Line 23: .Rules(rules => {
Line 24: rules.Add("~", "/[+-]/");
Line 25: })
Line 26: .Mask("~0000") //Set a mask with custom rule