A
Alan Silver
Hello,
I have a user control that can show info in a number of different ways.
I do this by having several .ascx files, all of which refer to the same
..cs file.
I can't work out where to put this .cs file so that it will work. The
..ascx files are in the root of the web site, and if I put the .cs file
in there, then the compiler gives me the error "Unable to cast object of
type 'ASP.ShowCategory' to type 'ShowCategory" which I assume means it
can't find the class. If I put the .cs file in the App_Code folder, then
it tells me that is not allowed.
In case it helps, the top of one of the .ascx files looks like...
<%@ Language="C#" Inherits="ShowCategory" ClassName="ShowCategory"
CodeFile="ShowCategory.cs" %>
and the top of the .cs file (ignoring "using" statements) looks like...
public partial class ShowCategory : UserControl {
Any ideas? I'm really stuck here. TIA
I have a user control that can show info in a number of different ways.
I do this by having several .ascx files, all of which refer to the same
..cs file.
I can't work out where to put this .cs file so that it will work. The
..ascx files are in the root of the web site, and if I put the .cs file
in there, then the compiler gives me the error "Unable to cast object of
type 'ASP.ShowCategory' to type 'ShowCategory" which I assume means it
can't find the class. If I put the .cs file in the App_Code folder, then
it tells me that is not allowed.
In case it helps, the top of one of the .ascx files looks like...
<%@ Language="C#" Inherits="ShowCategory" ClassName="ShowCategory"
CodeFile="ShowCategory.cs" %>
and the top of the .cs file (ignoring "using" statements) looks like...
public partial class ShowCategory : UserControl {
Any ideas? I'm really stuck here. TIA