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

前端 未结 6 1474
醉梦人生
醉梦人生 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:09

    You could pass a querystring parameter to Script.aspx (which will help you identify that it was called from WebPage.aspx).

    Server.Execute("script.aspx?xFrom=webPage.aspx")

    EDIT: I think the Request should have some value in it for you to know that it is running webpage.aspx.

    EDIT2: Request.Url?

提交回复
热议问题