Rather than go into all the gory details of why I need to do this,
let's just say I have a need to determine dynamically to what URL a
page will redirect. I'm passing along the destination URL in the
querystring, so capturing that is easy enough. But since this page must
first display its HTML, I can't just use a Response.Redirect().
So,
I decided to use the HTML-based <meta equiv="refresh"> tag.
However, I couldn't seem to get ASP.NET to allow me to use inline code
to grab the querystring parameter to insert into the content attribute.
What
about making the meta tag an object? I slapped a runat="server" and an
ID="metaTag" in the meta tag, then in the code behind I could do this:
string url = Request.Querystring["url"];
metaTag.Content = "15;url=" + url;
I still don't know why the inline code wouldn't work, but this way seems cleaner to me anyway.