|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem using themes in web user controlsI cannot get my app to compile because there is no way to tell the web user
control which theme to use and hence all of my links within that theme (images, css) are wrong. I think I should be able to do this on the server side programatically but that surely cant be the best way. Has any one got any ideas? "Geoff" wrote: imgLogin.Src = string.Format("~/App_Themes/{0}/Images/login.gif", > I think I should be able to do this on the server side programatically but > that surely cant be the best way. this.Page.StyleSheetTheme.ToString()); This is how I am currently doing it. This is identical to the way I was doing it for .net 1.1 (except I pulled the value from my own base class property that was intern pulled from a db) I don't know if I will get a better answer but it just feels like all of this should be in the theme. If I dont get a suitable answer I will just write something in the base class which will cycle round my image controls and update the reference automatically. Although this means I will have to statically point all images to the a app_themes folder in design mode. Hmmm its amazing how you can ramble about wrong asnwers when there is a
really simple solution staring you in the face. Anyway, after some advice via a different thread I decided to replace the server side code with skin files. It has just taken me the best part of 8 hours to do a small site (10 aspx, 14 ascx with 120 skin entries). I can honestly say it was worth the effort. Show quoteHide quote "Geoff" wrote: > "Geoff" wrote: > > > I think I should be able to do this on the server side programatically but > > that surely cant be the best way. > > imgLogin.Src = string.Format("~/App_Themes/{0}/Images/login.gif", > this.Page.StyleSheetTheme.ToString()); > > This is how I am currently doing it. This is identical to the way I was > doing it for .net 1.1 (except I pulled the value from my own base class > property that was intern pulled from a db) > > I don't know if I will get a better answer but it just feels like all of > this should be in the theme. > > If I dont get a suitable answer I will just write something in the base > class which will cycle round my image controls and update the reference > automatically. Although this means I will have to statically point all images > to the a app_themes folder in design mode.
WebParts without SharePoint
ReportViewer Causing Major Problems ERROR: The state information is invalid for this page and might be corrupted Problem accessing controls Properties do not reliably persist using CompositeControl file upload and download Formfields in Repeaters - validation and save into DB SiteMap resolve question Any way to set attributes for server controls by referencing properties/methods/variables? Enter text in at least one textbox |
|||||||||||||||||||||||