0
我剛碰到一個問題。在Page_Init方法中獲取頁面的URL之前。現在,要根據URL中的頁面加載CSS,我必須將該方法轉換爲OnPreRender事件。在asp.net中的OnPreRender事件中獲取頁面url
HttpContext.Current.Request.RawUrl
但是,當我這樣做,我不是能夠得到的頁面URL。我所得到的是「Page-Not-Found.aspx」。 有沒有辦法在OnPreRender方法中獲取URL? 感謝
你試過HttpContext.Current.Request.Url.AbsoluteUri? – Russell