In my MVC application, I use Ajax Post using jquery. Example is shown below
var postData = {recordID: selectedRecord}; $ AJAX ({Type: "Post", Data: Postdata, url: '& lt;% = Url.Action ("LoadAudio Player", "Search")%> Success, Action: Results (Results) {Warning (Results );}, Error: Work (Results) {Warning ('Error');}}); In the task of creating a virtual path of a .wav file. How can I do a download prompt in the user
public string load audio player (string record id, search modals search modell) {// some operation path = getPath (); \\ Getting the Virtual Path of File Return Path; } I can see the reason for the path because I keep a warning. I want to make an indication for the user whether it wants to download the file or not. How can I handle it with jquery?
You will have to open a new window in your success function as a window (pop up) with. This client will query the file stored on your server from the server and ask the client that he wnats to download it.
var postData = {recordID: selectedRecord}; $ Ajax ({Type: "Post", Data: Postdata, url: '& lt;% = Url.Action ("LoadAudio Player", "Search")%> Success, Action: Results (Results) {window.open (Result, '', '');}, error: work (result) {warning ('error';}});
Comments
Post a Comment