0

In classic ASP, the way to loop through all request's server variables was like this:

for each x in Request.ServerVariables
   response.write(x & " = " & Request.ServerVariables(x) & "<br />")
next

To get an individual variable such as http_user_agent you would call

Request.ServerVariables("http_user_agent")

In ASP.NET, you run

 foreach (string s in Request.Params.Keys)
     s.ToString() + " - " + Request.Params[s];

Session variables are obtained like this:

 foreach (string s in Session.Keys)
            s.ToString() + " - " + Session[s];

How can I loop through server and session variables in a Blazor server app running on an IIS server?

Andres
  • 192
  • 1
  • 14
  • 1
    See @Enet's answer to this question on how to access the httpcontext - See this answer on how to get access to the HttpContext - https://stackoverflow.com/questions/53817373/how-do-i-access-httpcontext-in-server-side-blazor. Remember this is a SPA so it only contains the information for the SPA initial page. – MrC aka Shaun Curtis Oct 20 '22 at 16:35
  • Thank you! Can you define SPA? – Andres Oct 21 '22 at 17:11
  • SPA: Single Page App... got it! :) – Andres Oct 21 '22 at 17:15

0 Answers0