javascript - How to pass C# parameter over window.showModalDialog() to MVC Action Result? -
i have page in .net mvc project calls pop using javascript. need send property model on actionresult can work it.
what page looks like
<script type="text/javascript"> //function print() { // $(".btnprint").printpage(); showpopup = function () { window.showmodaldialog("/fileupload/getpopupdata/ --pass model property, do? --", "wndpopup", "width=300,height=500"); }
my action result want use property
public actionresult getpopupdata(int consignmentid) { var test = consignmentid; //call pop view , populate accordingly return new getdocumenttypeaction<actionresult> { onloaded = m => view("../../areas/exports/views/fileupload/fileupload", m), onerroroccured = (m) => redirects.toerrorpage() }.execute(gtsclient); }
try querystring:
"/fileupload/getpopupdata?consignmentid=" + '@model.consignmentid'
just make sure property names match method signature given action.
Comments
Post a Comment