or
@model MyApp.ViewModels.JobTitleViewModel@(Html.Kendo().DropDownListFor(m => m).DataValueField("Id").DataTextField("Name").DataSource(r => r.Read("GetAll", "JobTitles")).HtmlAttributes(new { style = "width:90%" }))[AllowAnonymous]public JsonResult GetAll(){ var titles = context.JobTitles .Where(e => e.IsActive == true) .OrderBy(e => e.Name) .Select(t => new JobTitleViewModel { Id = t.Id, Name = t.Name, IsActive = t.IsActive }); return this.Json(titles, JsonRequestBehavior.AllowGet);}@model MyApp.Models.RegisterViewModel@{ ViewBag.Title = "Register";}<h2>@ViewBag.Title</h2>@using (Html.BeginForm("Register", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form" })){ @Html.AntiForgeryToken() <hr /> @Html.ValidationSummary("", new { @class = "text-danger" }) <div class="form-group"> @Html.LabelFor(m => m.FullName, new { @class= "col-md-2 control-label"}) <div class="col-md-10"> @Html.TextBoxFor(m => m.FullName, new { @class="form-control"}) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.JobTitle.Name, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.EditorFor(m => m.JobTitle, new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Email, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.TextBoxFor(m => m.Email, new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.PasswordFor(m => m.Password, new { @class = "form-control" }) </div> </div> <div class="form-group"> @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-md-2 control-label" }) <div class="col-md-10"> @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" }) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" class="btn btn-default" value="Registra" /> </div> </div>}@section Scripts { @Scripts.Render("~/bundles/jqueryval")}public class RegisterViewModel{ [Required] [EmailAddress] [Display(Name = "Email")] public string Email { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } [StringLength(80, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 4)] [Display(Name = "Name")] public string FullName { get; set; } [UIHint("JobTitleEditor")] public JobTitleViewModel JobTitle { get; set; }}The parameter conversion from type 'System.String' to type 'MyApp.ViewModels.JobTitleViewModel' failed because no type converter can convert between these types.@(Html.Kendo().Grid<Data>() .Name("Detail") .ToolBar(tool => { tool.Create().Text("New Project");}) .Columns(columns =>{ columns.Bound(f => f.PROJECT).Title("Project Name").ClientTemplate("#: PROJECT.PROJ_NAME #"); columns.Bound(f => f.PROJSTAGE).Title("Stage").Width(400).ClientTemplate("#: PROJSTAGE.PROJ_STAGE #"); columns.Bound(f => f.REMARK).Title("Remark"); columns.Command(commands => {commands.Edit();}); }) .Editable(e => { e.Mode(GridEditMode.InLine).DisplayDeleteConfirmation(false); }) .DataSource(dataSource => dataSource .Ajax() .Model(m => { m.Id(f => f.SEQ_ID); m.Field(f => f.PROJECT).DefaultValue(ViewData["defaultProject"] as DPA.ETimelog.Models.Project); m.Field(f => f.PROJSTAGE).DefaultValue(ViewData["defaultProjStage"] as PA.ETimelog.Models.ProjStage); m.Field(f => f.REMARK);})
.Read(read => read.Action("test_read", "Home")) .Create(create => create.Action("test_create", "Home")) ) )@model object<script> function eProjectReadData() { return { startDate:selectedDate.toJSON() }; }</script>@( Html.Kendo().DropDownListFor(m => m) .OptionLabel("-please select-") .HtmlAttributes(new { style = "width: 200px" }) .DataTextField("PROJ_NAME") .DataValueField("PROJ_NO") .DataSource(source => {source.Read(read =>{read.Action("GetProjectAssignedToMember", "eProject").Data("eProjectReadData");});}) )@model object@( Html.Kendo().DropDownListFor(m => m) .OptionLabel("-please select-") .DataTextField("PROJ_STAGE") .DataValueField("PROJ_STAGE_ID") .DataSource(source => { source.Read(read => { read.Action("GetProjStage", "Home");}); }))c.Command(command => {command.Edit().HtmlAttributes(new { @class = "btn" }).UpdateText("Save");command.Destroy().HtmlAttributes(new { @class = "btn" }); });<a class="k-button k-button-icontext k-grid-edit" href="#">var staffId = '@Html.Raw(Json.Encode(Model.StaffModel.StaffId))'; var windowk = $("#staffsec").data("kendoWindow");windowk.refresh({< url: "@Url.Content("/StaffSecurity/Index/")", data: { id: staffId });<br>windowk.title("Staff Security"); windowk.open();return event.preventDefault();
