how to stop application asp.net with global.asax -


i want stop application asp.net mvc in session_start after test , show user isn't authorized application

 protected void session_start(object sender, eventargs e)  {      if (test)      {          //stop application          // user : not authorized      }  } 

finally send response , close session , works

protected void session_start(object sender, eventargs e)      {          if (test)          {               asciiencoding encoding = new asciiencoding();                     string postdata = "<h2 style=\"color:red;\">vous n'avez pas  l'authorisation pour utiliser application!!</h2>. ";                     byte[] data = encoding.getbytes(postdata);                     char[] buf = postdata.tochararray();                     httpcontext.current.response.write(buf, 0, buf.count());                     httpcontext.current.response.flush();                     httpcontext.current.applicationinstance.completerequest();                      session.abandon();          }      }        

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -