c# - How to access Session in .ashx file? -


I want to enter some value in the .hx file (which has already been set in.aspx file) I am I tried to use that value query string, session etc. but it failed every time. Anyone can suggest me how can we get the value of the session in .hx file?

in ASPX file:

  session. Add ("Filename", "Test Test");   


After you set the session value in the aspx file. Use the following to get value in the ashx file.

In Ash file:

  Public class ImageHandler: IHttpHandler, System.Web.SessionState.IRequiresSessionState {Public Zero Processor (HttpContext) Context) {string name = ""; If (context.Session ["filename"] = = null) name = reference Session ["file name"]. ToString (); }}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -