Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. [WebMethod(true)]
  2. public string DoSomethingOnTheServer() { }
  3.  
  4. private void Application_BeginRequest(object sender, EventArgs e)
  5. {
  6. // This will set the session to read only for asmx services
  7. // This will make the asmx services non blocking for other requests as it doesnt lock the session object
  8. if (Context.Request.Path.Contains(".asmx/"))
  9. {
  10. Context.SetSessionStateBehavior(SessionStateBehavior.ReadOnly);
  11. }
  12. }
  13.  
  14. [WebMethod(EnableSession=true)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement