I want to use a javascript uploader in my C# project. The javascript gets loaded in the master page, and in the partial view where I want the uploader to be I have the following code:
<a class="upload" href="/Administration/blue/en-gb/Entity/StoreFile/97?Entity=Note&Field=File">uploadfile</a>
However, when I click the button I get an '"This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet." error. The same kind of question can be found here. However, as a solution something like the following is given:
return Json(new { mymsg = "my msg" }, JsonRequestBehavior.AllowGet);
Where adding JsonRequerstBehavior.AllowGet solves the problem.
In my C# ActionResult that calls the PartialView in which I Want to add this I have this as a return:
return PartialView("CreateNotePartial", Model);
I also tried:
<%$.post('/blag/JSON', function (data) {%>
<a class="upload" href="/Administration/blue/en-gb/Entity/StoreFile/97?Entity=Note&Field=File">uploadfile
</a>
<%});%>
but that did not work.
I can not add the JsonRequestBehavior.AllowGet. How can this be made to work without this .AllowGet?