or
public class ExportData { public DateTime startDate { get; set; } public DateTime endDate { get; set; } public string exportType { get; set; } }@using Microsoft.AspNet.Identity@using Kendo.Mvc.UI@model InsulinCalculator.Models.ExportData@using (Html.BeginForm("Export", "Home", FormMethod.Post)){ <div class="form-group"> <label class="col-md-2 control-label" for="dtpStartDate" style="white-space:nowrap;">Start Date:</label> <div class="col-md-3"> <div class="input-group"> @(Html.Kendo() .DatePickerFor(model => model.startDate) .Name("dtpStartDate") .Format("MM/dd/yyyy") .HtmlAttributes(new { style = "width:180px" }) ) </div> </div> </div> <div class="form-group"> <label class="col-md-2 control-label" for="dtpEndDate" style="white-space:nowrap;">End Date:</label> <div class="col-md-3"> <div class="input-group"> @(Html.Kendo() .DatePickerFor(model => model.endDate) .Name("dtpEndDate") .Format("MM/dd/yyyy") .HtmlAttributes(new { style = "width:180px" }) ) </div> </div> </div> <div class="form-group"> <label class="col-md-2 control-label" for="exportType" style="white-space:nowrap;">Format:</label> <div class="col-md-3"> @(Html.Kendo() .DropDownListFor(model => model.exportType) .Name("exportType") .HtmlAttributes(new { style = "width:180px" }) .BindTo(new List<string>() { "Microsoft Excel (XLSX)", "Microsoft Word (DOCX)", "Adobe Acrobat (PDF)" }) ) </div> </div> <div class="form-group"> <div class="col-sm-4"> <input type="submit" value="Export Data" class="btn btn-sm bg-purple2 pull-right"> </div> </div>}[Authorize][HttpPost]public ActionResult Export(ExportData oData) { Response.Write(oData.startDate + " " + oData.endDate + " " + oData.exportType); return View();}
@{ Html.Kendo() .Grid<Teamnet.eViza.Model.Entities.App.DocumentData>() .Name("gridDocumentData") .Columns(columns => { columns.Bound(c => c.Id); columns.Bound(c => c.IssuedByAuthority); columns.Bound(c => c.IssuedCountry) .ClientTemplate("#=(IssuedCountry == null) ? '' : IssuedCountry.roDescription #") .EditorTemplateName("NomLookup"); columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200); }) .DataSource(dataSource => { dataSource.Ajax() .CrudWithQueryAndDefaultCommands( new Teamnet.eViza.Business.Queries.AllEntitiesOfTypeName(typeof(Teamnet.eViza.Model.Entities.App.DocumentData)), "DocumentData") .AutomaticRefreshed(); dataSource.Ajax() .Model(model => model.Id(a => a.Id)); dataSource.Ajax().PageSize(10); }) .ToolBar(toolbar => toolbar.Create()) .Editable(editable => editable.Mode(GridEditMode.InLine)) .AutoBind(true) .Pageable() .Filterable() .Sortable() .Render();}@model Teamnet.eViza.Model.Entities.BaseNom@(Html.Kendo().ComboBoxFor(a => a) .DataTextField("roDescription") .DataValueField("Id") .Filter(FilterType.StartsWith) .HighlightFirst(true) .MinLength(1) .DataSource(dataSource => dataSource.Read(read => read.Action("Read", "NomComboBox", new { nomType = Teamnet.eViza.WebCommon.Utils.TypeUtils.FullNameWithAssembly(ViewData.ModelMetadata.ModelType) }) ).ServerFiltering(true)) .SelectedIndex(0))