I have found this code in my CSS View Details. I want to send VM back to this controlling method. This works because I can set a breakpoint in the controller, although the model is empty. Here's the client-side
function download file () {$. AJAX ({url: '/ software / download install', type: "post", data: JSON.stringify ('@models'), datatype: "Jason", Content Type: "App / Jason; Charset = UTF-8 "}); } And it looks like my controller
[HTTP post] Public Action Resolve Downlld Install (Software Edit V Model VM) {try.software .ervice.downloadInstall (vm); Return Redirect Action ("Index"); } Hold {return (see); }}
I think it is impossible to create a complex model Being represented is that JSON.stringify can be used to pass the ID of the item you want to download back (possibly contained in the model). If download means what I think, then actually return one file result and you should not redirect later. There is no need to use AJAX, as the file download will not take you away from the page. I am making some big assumptions based on your nomenclature - if I am wrong then you really should use better names.
[HTTP Post] Public Action Download Install (Int ID) {Return Software Services Download Installation (ModelFormID); } Private Software View Modell ModelFromid (ID) {... to populate the required model to download from ID ...} client
Function download file () {Location.href = '/ software / downloadinstall /' + @ model Id; }
Comments
Post a Comment