Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Solution ... </p> <p>Tentatively - </p> <p>I cannot modify server variables and have them be 'picked up' by the classic asp code on the request; however I could get this code add in headers, so I'm going to use headers. If this is an awful way to be doing things please let me know in the comments! Thanks for helping me out Frank!</p> <p>SO here's the code: </p> <p>CLASSIC ASP: </p> <p></p> <pre><code>&lt;% for each x in Request.ServerVariables Response.Write("&lt;h2&gt;"&amp; x &amp; ":" &amp; Request.ServerVariables(x) &amp; "&lt;/h2&gt;") next Response.Write("&lt;h2&gt; DAVE: " &amp; Request.ServerVariables("HTTP_DAVE") &amp; "&lt;/h2&gt;") Response.Flush() %&gt; &lt;h2&gt;hello!&lt;/h2&gt; &lt;/html&gt; </code></pre> <p>HTTPMODULE: </p> <pre><code>namespace PlatoModules { public class PlatoModule : IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += (s, e) =&gt; BeginRequest(s, e); context.EndRequest += (s, e) =&gt; EndRequest(s, e); } public String ModuleName { get { return "test"; } } public void Dispose() { } // Your BeginRequest event handler. private void BeginRequest(Object source, EventArgs e) { Debugger.Launch(); HttpApplication application = (HttpApplication)source; HttpContext context = application.Context; try { context.Response.Write( "&lt;h1&gt;&lt;font color=red&gt;HelloWorldModule: Beginning of Request&lt;/font&gt;&lt;/h1&gt;&lt;hr&gt;"); context.Request.Headers.Add("DAVE", "DAVOLIO"); context.Response.Flush(); } catch (Exception ex) { context.Response.Write( ex.Message); } } private void EndRequest(object source, EventArgs e) { HttpApplication application = (HttpApplication)source; HttpContext context = application.Context; var content = @"&lt;hr&gt;&lt;h1&gt;&lt;font color=red&gt;HelloWorldModule: End of Request&lt;/font&gt;&lt;/h1&gt;"; context.Response.Write(content); context.Response.Flush(); } } } </code></pre> <p>Relevent web.config</p> <pre><code>&lt;system.webServer&gt; &lt;modules runAllManagedModulesForAllRequests="true"&gt; &lt;add name="PlatoModule" type="PlatoModules.PlatoModule" /&gt; &lt;/modules&gt; ... &lt;/system.webserver&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload