如何使用樣式-URL標記,HttpContext.Current.Request.Url.Host和HttpContext.Current.Request.Url.Authority on .aspx頁面(想要檢查它是否是localhost或不是直接)?三元條件之間的HttpContext.Current.Request.Url.Host和HttpContext.Current.Request.Url.Authority aspx頁
這裏是例子:
"div style='<%= "height: 1115px; background-image: url(\"" + "http://" + HttpContext.Current.Request.Url.Host.ToString() +"ImagePath"); background-position: bottom center; background-repeat: no-repeat;" %>'"
我要檢查它是否爲localhost,然後它會採取管理局,如果沒有,那麼它必須採取主機。
你可以發表你想要的樣本。 –
@PatrickHofman - 在我的項目中添加了一個div標籤。 –