【发布时间】:2011-11-30 11:06:44
【问题描述】:
我刚刚遇到了一个问题。在我在 Page_Init 方法中获取页面的 URL 之前。现在要根据 URL 中的页面加载 css,我必须将方法转换为 OnPreRender 事件。
HttpContext.Current.Request.RawUrl
但是当我这样做时,我无法获取页面 url。我得到的只是“Page-Not-Found.aspx”。 有没有办法在 OnPreRender 方法中获取 URL? 谢谢
【问题讨论】:
-
你试过 HttpContext.Current.Request.Url.AbsoluteUri 了吗?
标签: asp.net