Here is a straightforward WebMethod
:
[WebMethod(EnableSession=true)]
public static string Redirect()
{
object a= HttpContext.Current.Session;
return "yeppieee";
}
It is being called like this:
this.http.get(`http://localhost/MyApp/Pages/TestPage.aspx/Redirect`)
.map(res=>res)
.subscribe((res) =>{
console.log(res);
},
(err)=>console.log(err),
()=>console.log("Done1111111111")
);
Despite all this, the debugger does not hit.
In the console, I only see Done1111111111
.
The network tab in the developer tools shows that the status of this request is 200
, meaning OK
.
So why isn't the WebMethod
being executed?
Edit
I just discovered that the response is actually the entire HTML page. This can be seen in the console output.