Hi.
I want use attachURL to load a asp.net mvc page in the Window.
there is attachURL, it seems use http get, but i want post json to web server, How?
Thanks!
Hi.
I want use attachURL to load a asp.net mvc page in the Window.
there is attachURL, it seems use http get, but i want post json to web server, How?
Thanks!
Hi
It is not supported.
But you can try to load supplementary page with form and then call form.submit …
Need to specify: do you load URL or use AJAX?
hi.
I load URL, not use AJAX.
Asp.net mvc support json very well, json is very useful in asp.net mvc, so I want transfer the data use json object, i don’t want use the url to transfer data and url has some limit.
Thanks.
There is no such opportunity
You can specify true after the URL to have it loaded via Ajax instead of URL, that way you can easily transfer JSON objects to the controller from jscript.
javascript:
sURL = MY_URL;
sURL = AddURLParameter(sURL, "WindowID", sWindowID);
sURL = AddURLParameter(sURL, "UserID", CURRENT_USER_ID);
sURL = AddURLParameter(sURL, "GridID", oGridProps.ID);
sURL = AddURLParameter(sURL, "GridData", JSON.stringify(colGridData));
oWin.attachURL(sURL,true);
C# ViewModel
public class ConflictRequest
{
public bool IsValid(out string sError)
{
sError = "";
if (string.IsNullOrEmpty(WindowID) || string.IsNullOrWhiteSpace(WindowID))
{
sError = "The window ID was not provided.";
return false;
}
if (!UserID.HasValue)
{
sError = "User ID was not provided.";
return false;
}
return true;
}
public string GridID { get; set; }
public string WindowID { get; set; }
public Nullable<long> UserID { get; set; }
public string GridData { get; set; }
}
C# MVC controller:
[Authorize]
[HttpGet]
public ActionResult (Request oRequest)
{
string sError;
if (!oRequest.IsValid(out sError))
return RedirectToAction("ModelError", "Error", new { Area = "", Message = sError });
return View("Window", oRequest);
}