.net - Webgrid SelectedLink URL Issue -
i have webgrid
. when selecting id column displays partial view further details on item.
it working fine lately strange timestamp has appeared when pressing/highlighting id link;
localhost:xxxxx/page?selectedrow=1&__swhg1234567890
example.
the '&__swhg1234567890
' needs removed have no idea why appearing in url
, causing the webgrid
links not work.
it handled in index.cshtml
var grid = new webgrid(model, canpage: true, cansort: true, rowsperpage: 20, defaultsort: "projno", selectionfieldname: "selectedrow", ajaxupdatecontainerid: "gridcontent"); <div id="gridcontent"> @grid.gethtml(tablestyle: "table", headerstyle: "head", alternatingrowstyle: "altrow", selectedrowstyle: "selectrow", columns: grid.columns(grid.column("id", "id", format: (item) => item.getselectlink(item.id)), grid.column("text", "text", format: (item) => item.text == null ? string.empty : item.text), grid.column(header: "actions", format: (item) => new htmlstring(html.actionlink("edit", "edit", new { id = item.id }).tostring() + html.actionlink("delete", "delete", new { id = item.id }).tostring())))) </div> @{ ims.models.entities.page page= new ims.models.entities.page(); } @if (grid.hasselection) { page= (ims.models.entities.page)grid.rows[grid.selectedindex].value; <div id="deschead"> detail goes here </div> <br />
any appreciated.
it turns out ajax problem. removing unused 'ajaxupdatecontainerid' parameter corrected problem.
Comments
Post a Comment