javascript - Kendo window.refresh not successfully grabbing partial view -
all. thank in advance.
i have window refresh every time dropdown selection changed (or button pressed). controller being called upon refresh, view not being called/refreshed, reason. missing fundamental?
window:
@(html.kendo().window() .name("editwindow") .title("edit contact") .loadcontentfrom("_contactedit", "contacts", new { selectedcontact = model.contactid }) .content("loading...") .visible(false) .draggable() .resizable() .width(400) .modal(true) .actions(actions => actions.pin().minimize().maximize().close()) )
refresh code (in javascript):
var combobox = $("#contactid").data("kendocombobox"); var contactid = combobox.value(); var window = $("#editwindow").data("kendowindow"); window.refresh({ url: "../../contacts/_contactedit", data: { selectedcontact: contactid } //url: "/contacts/_contactedit/?selectedcontact=contactid" });
controller:
[httpget] public actionresult _contactedit(int selectedcontact) { var entities = r in dbcontext.contacts r.contactid == selectedcontact select r; if (entities.any()) { return partialview(entities.first()); } else { return httpnotfound("contact not exist."); } }
i know partial view working correctly because it's called , populates upon initial window load. why in world can't refresh?
edit: here's partial view (window contents):
@model pnc.cm.mbs.bizservicetier.iidb.contact @using kendo.mvc.extensions @using (html.beginform()) { @html.antiforgerytoken() @html.validationsummary(true) <fieldset id="infoform">hello, world. @html.hiddenfor(model => model.contactid, new { id = "editwindowid" }) <br /> <label id ="contactnameid" style="width: 130px;">contact name</label> <span> @html.textboxfor(model => model.fullname, new { type = "text", id = "editwindowname", @class = "k-textbox form-control", style = "width: 200px; cursor:default" }) </span><br /> </fieldset> }
Comments
Post a Comment