Last post Feb 17, 2008 06:31 AM by ivl
Feb 15, 2008 12:10 AM|ballistic|LINK
I created a set of user controls inside my website. I now would like to make them reusable and am following Scott Guthrie's example "Building Re-Usable ASP.NET User Control and Page Libraries with VS 2005" (http://weblogs.asp.net/scottgu/archive/2005/08/28/423888.aspx).
I went ahead and created another website which contains just my controls. However, these controls use code which was in my App_Code directory, so I then decided to move the code in my App_Code into it's own Class library. However, when I do that, I loose
the ability to access HttpContext along with not being able to access any UI controls.
Would like to have my controls in a reusable library but not sure how else to approach this.
Feb 15, 2008 05:15 AM|ParrotBoy|LINK
Why do you not have access to these features? As long as you import the proper namespaces (the System.Web DLL) and make sure that the DLL is only called from a web application (so that HTTPContext.Current is available) you'll be fine. Also I'm not totally
sure what you mean by "not being able to access any UI controls", could you please clarify?
Feb 17, 2008 06:31 AM|ivl|LINK
You have two options for custom controls: