How to detect if an aspx page was called from Server.Execute?

前端 未结 6 1449
醉梦人生
醉梦人生 2021-01-13 13:38

I have the following example page structure:

  • Webpage.aspx
  • Script.aspx

If I call Server.Execute(\"Script.aspx\") from Webpa

6条回答
  •  日久生厌
    2021-01-13 14:13

    HttpRequest.FilePath will return the URL to the page requested, which you can then do a substring match on for "Script.aspx".

    (Take this answer with a huge grain of salt though, my .Net is pretty poor.)

提交回复
热议问题