i have the next problem: i'm creating an ajax call to a .cshtml file... in localhost it works fine, but when uploaded on server it throws an error "Forbidden (403)"
this is my ajax call:
$.ajax({
type: "GET",
url: "~/MyProcessPage.cshtml",
contentType: "application/x-www-form-urlencoded",
data: { id: 1 },
crossDomain: true,
success: function (res) {
console.log(res);
},
error: function (res) { console.log(res); },
dataType: 'json'
});
and this is my C# code:
if (HttpContext.Current.Request.HttpMethod == "GET")
{
var id= Convert.ToInt32(Request.QueryString["id"]);
Response.Write(id);
}
Please notice i'm using razor but NOT using MVC!
Thanks!