Print all session/post/get variables in ASP.NET page

asp.net, session, session-variables, variables

Solution

with box being a label.

foreach (string i in Session.Contents) {
  if (Session[i] != null) {
    box.Text += i + " = " + Session[i].ToString() + "\n";
  }
}

Problem

I am very new to ASP.NET, I'm quite used to PHP (which we unfortunately do not use at work) I'd like to print all the session variables. In PHP it's quite easy, I use: ``` echo '<pre>' . print_r($_SESSION, true) . '</pre>'; ``` for this, but is there an as-easy ASP.NET equivalent?

Original source