<p>I have a control where I have to check in which page I am, so I can set a certain variable accordingly.</p>

<pre><code>string pageName = this.Page.ToString();
switch (pageName)
{
case "ASP.foo_bar_aspx": doSomething(); break;
default: doSomethingElse(); break;
}
</code></pre>

<p>this works fine locally and on some developmentservers, however when I put it live, It stopped working because I don't get <code>ASP.foo_bar_aspx</code> but <code>_ASP.foo_bar_aspx</code>
(notice the underscore in the live version)
Why does it act that way, Can I set it somehow?</p>

That seems like a really dodgy way of getting the current request. Have you tried using
```
HttpContext.Current.Request.FilePath
```
or another
```
HttpContext.Current.Request...
```
variable instead?