" greg" < gr ** @ metastorm.no.spam.com在消息新闻中写道:eJ ************** @ TK2MSFTNGP06.phx.gbl ...You probably can get around this problem by building a string path to the correct directory.You know all the themes reside under the App_Themes directory :WebSite\App_Themes\ BlueThemeControls.skinBlueTheme.css\PinkThemeControls.skinPinkTheme.cssIf you set the Theme in the querystring :Protected void Page_PreInit(object sender, EventArgs e){switch (Request.QueryString["theme"]){case "Blue":Page.Theme = "BlueTheme";break;case "Pink":Page.Theme = "PinkTheme";break;}}....you can build a path to the correct directory you want to use for the images.For a relative path to the directory for the current theme:Page.AppRelativeVirtualPath + "/" & App_Themes + "/" + Request.QueryString["theme"]) +"/"For the fully qualified path to the directory for the current theme :string fullappname = Request.Url.Hoststring fullpath = "http://" + fullappname + Request.ApplicationPath + "/" + App_Themes + "/" +Request.QueryString["theme"])+"/"Please double check the syntax, as I usually work in VB.NET...Juan T. Llibre, asp.net MVPasp.net faq : http://asp.net.do/faq/foros de asp.net, en espa?ol : http://asp.net.do/foros/======================================"greg" <gr**@metastorm.no.spam.comwrote in message news:eJ**************@TK2MSFTNGP06.phx.gbl... 这篇关于在设计时获取当前主题名称。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-26 06:27