tag:blogger.com,1999:blog-4292687466688891558.post493246626927889686..comments2024-03-22T06:03:31.023-04:00Comments on Chapman's Coding Corridor: ApplyStyleSheetSkin On System.Web.UI.Control?John Chapmanhttp://www.blogger.com/profile/06903416900062029948noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4292687466688891558.post-45677257820187869432007-10-25T18:51:00.000-04:002007-10-25T18:51:00.000-04:00Flip, you raise valid points, but I guess I was ju...Flip, you raise valid points, but I guess I was just viewing these controls a little differently. These controls are intended to be usable across all applications. How often do you need to add web.config settings when you add a textbox to an application? Typically you configure the textbox (like MaxLength) with a property, and if you want a default you use a stylesheetskin. The .config file would certainly work though, it just didn't seem like the clean approach. That being said, this method should just work. I can't figure out why it exists on the System.Web.UI.Control yet can't be used on an item which inherits from it but not WebControl!John Chapmanhttps://www.blogger.com/profile/06903416900062029948noreply@blogger.comtag:blogger.com,1999:blog-4292687466688891558.post-46273471440941184422007-10-25T08:49:00.000-04:002007-10-25T08:49:00.000-04:00Another thing you could do would be to read from t...Another thing you could do would be to read from the AppSettings of the ConfigurationManager. Very similar to the skin if you want a GLOBAL setting, also may allow you a little more flexible change in a prod environment if your values change frequently. You wouldn't have to make a PUSH (this assumes that the Skin File isn't updatable which in your case it might be).Flip44https://www.blogger.com/profile/18163484668893343424noreply@blogger.comtag:blogger.com,1999:blog-4292687466688891558.post-12141113453299224012007-10-25T08:48:00.000-04:002007-10-25T08:48:00.000-04:00Another thing you could do along the lines of the ...Another thing you could do along the lines of the SKIN would allow your control to read fron the Appsettings of the ConfigurationManager for some of these common properties. This may allow you more flexibility w/o having to repush if your settings need to change.Flip44https://www.blogger.com/profile/18163484668893343424noreply@blogger.com