User Control

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

I have a working aspx page, that I want to turn into a User Control.
(it's a simple chart that I want to drop onto other pages throughout
the application)

(The aspx page Inherits a Class from a src .vb file.)

I thought I could simply remove any html from the aspx file, change
the Page declarative to Control (top of page) and then register my new
ascx file in any aspx page I wanted.

However, I get the following error:

'SQLClass' is not a valid base class because it does not extend class
'System.Web.UI.UserControl'.

I added "Imports System.Web.UI.UserControl" to the .vb file, and the
class continues to work for other aspx pages.

Any ideas? thank you
 
Brad,

SQLClass need to *inherit* from System.Web.UI.UserControl. If it was a
page, it probably inherits from Page. Try changing the inheritance from
Page to UserControl.

Imports (vb) or using (C#) directives will not influence inheritance, they
only allow you to reference partially qualified class names in your code.

--Bob
 
Back
Top