[Controller]
[HttpPost]
public ActionResult TextBoxesFeatures(EditorValue model)
{
return View(model);
} |
public class WidgetDto
{
[MaxLength(10)]
[Required]
public string Name { get; set; }
[MaxLength(15)]
[DataType(DataType.PhoneNumber)]
[RegularExpression(@"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$", ErrorMessage = "Not a valid Phone number")]
public string Phone { get; set; }
[MaxLength(50)]
[RegularExpression("^[a-zA-Z0-9_\\.-]+@([a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", ErrorMessage = "E-mail is not valid")]
public string Email { get; set; }
public bool Switch1 { get; set; }
public bool Switch2 { get; set; }
public DateTime MyDate { get; set; }
public JobType Type { get; set; }
[Range(1, 10)]
public int MyNumber { get; set; }
}
public async Task<PartialViewResult> CreateOrEditModal(int? id)
{
var output = await _widgetAppService.GetWidgetForEdit(new NullableIdDto { Id = id });
return PartialView("_CreateOrEditModal", output);
}
View:
@model SmartAgentNZ.SmartAgentNG.Dto.WidgetDto
<form name="WidgetForm" role="form" novalidate class="form-validation">
@Html.AntiForgeryToken()
<div class="form-horizontal">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
@Html.HiddenFor(model => model.Id)
...
<div class="form-group">
@Html.LabelFor(model => model.Phone, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">@Html.EJ().MaskEditTextBoxFor(m => m.Phone).MaskFormat("(999)999-9999")
<br />
@Html.EJ().MaskEdit("maskedit").MaskFormat("(999)999-9999").InputMode(InputMode.Text).Value("7775551234")
</div>
</div>...In the example above both the MaskEditTextBoxFor and the hard-coded MaskEdit helpers display '(___)____-_____' instead of the respective values. In the case of the MaskEdit (which was put in for testing), that helper is not reliant on any model value being passed in, the value is hard coded on the helper '.Value("7775551234")' yet all that I get displayed is an a masked text box without the value. What would block the helper from placing the value in the outputted web page? All other Syncfusion helpers on the page are working properly NumericTextbox, checkboxes etc).
Thanks,
Steve