Ika Palad

Ika Palad

  • NA
  • 51
  • 2k

ASP.NET MVC: Partial View is not rendering

Jan 4 2022 7:38 PM

Hello Community, 

I'm trying to use an Ajax call to load in partial views on click of a row within the grid however it seems the partial view is not rendering. What did I missed

 

Index.cshtml

@{ViewBag.Title = "DialogTemplateEdit";
}
@using Syncfusion.EJ2

@Html.EJS().Grid("FlatGrid").DataSource(dataManager => { dataManager.Url("/Home/UrlDatasource").Adaptor("UrlAdaptor").UpdateUrl("/Home/editpartial"); }).ActionComplete("actionComplete")

.Columns(col =>

{col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).ValidationRules(new { required = true, minLength = 3 }).Width("100").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();

col.Field("ShipCountry").HeaderText("Ship Country").Width("120").TextAlign(Syncfusion.EJ2.Grids.TextAlign.Right).Add();

col.Field("ShipCity").HeaderText("Ship City").EditType("dropdownedit").Width("120").Add(); }).

AllowPaging().PageSettings(page => page.PageCount(2)).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog).Template("#dialogtemplate"); }).Toolbar(new List() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render()

 

 

This Partial View is not rendering

editpartial.cshtml

@model AspNetMvc5.Models.DialogTemplateModel
@*//define the model for store the model values*@@using Syncfusion.EJ2

@Html.TextBox("OrderID", Model.OrderID.ToString(), new { disabled = true })@Html.Label("OrderID", "Order ID", new { @class = "e-float-text e-label-top" })

@Html.TextBox("CustomerID", Model.CustomerID.ToString())@Html.Label("CustomerID", "Customer Name", new { @class = "e-float-text e-label-top" })

@Html.EJS().NumericTextBox("Freight").Value(Model.Freight).Format("C2").Placeholder("Freight").FloatLabelType(Syncfusion.EJ2.Inputs.FloatLabelType.Always).Render()

@Html.EJS().DatePicker("OrderDate").Value(Model.OrderDate).Placeholder("Order Date").FloatLabelType(Syncfusion.EJ2.Inputs.FloatLabelType.Always).Render()

@Html.EJS().DropDownList("ShipCountry").Value(Model.ShipCountry).Fields(new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings { Text = "ShipCountry", Value = "ShipCountry" }).Placeholder("Ship Country").FloatLabelType(Syncfusion.EJ2.Inputs.FloatLabelType.Always).DataSource((IEnumerable)@ViewBag.datasource).Render()

@Html.EJS().DropDownList("ShipCity").Value(Model.ShipCity).Fields(new Syncfusion.EJ2.DropDowns.DropDownListFieldSettings { Text = "ShipCity", Value = "ShipCity" }).Placeholder("Ship City").FloatLabelType(Syncfusion.EJ2.Inputs.FloatLabelType.Always).DataSource((IEnumerable)@ViewBag.datasource).Render()

@Html.TextArea("ShipAddress", Model.ShipAddress)@Html.Label("ShipAddress", "Ship Address", new { @class = "e-float-text e-label-top" })

@Html.EJS().ScriptManager()


Answers (1)