jquery - Opening a modal dialog upon success of ajax post in another modal MVC -
IM stuck in MVC modal dialogue, when I click on a button inside a modal dialog, I want to open a modal dialog. Ajax gives a new dialog that for posting data for an action, the problem is that the call is sent in the action but it never gives the dialog box any more way to do this. Some code:
function LoadRightsDialog () {// $ ("# form0"). Close (); Var list = []; Var elems = document.getElementById ('Fate'). Children; (I = 0; i & lt; elems.length; i ++) {if (ames [i] .toString () == "[object HTMLDivElement]") {list.push (ames [i] .id); }} //alert(list.length) var json = JSON.stringify (list) //$.post(_/DistributionList/SaveMyData/ ", {jsonData: jlst} var templateId =" & lt;%: TempData [" ProjectID "]%: // alert (template id) $ .ajax ({type:" GET ", url:" / temporary / ADSID lock save ", data: {jsonUser: json, template id: template}, Success: Work (Window.location.href = data; // alert (data.Result);}, datatype: "json", traditional: true}); $ (".ui-dialog-content"). Dialog ("off");} The event that calls this function
and controller action
public functions AddRightsDialog (string jsonUser, string templateId) {Partial view returned partial view (); // it loads modal dialogs}
The action must be the right action method name in the string that does not contain html of HTML and JSON.
Controller's name is TempController and the matching route is the default, you will need to edit the url and datatype parts as your AJAX call therefore: < Previous> $ Ajax ({type: "GET", url: "/ temporary / AddRightsDialog", data: {jsonUser: json, templateId: templateId}, success: function (data) {Window.location.href = data; // warning Results);}, traditional: true}};
Comments
Post a Comment