thought I'd let you know it's 100% working after I added
Src="TemplateTop.ascx.cs"
to the @Control directive
This puzzles me though. It tells me that the Codebehind code has to be
precompiled by Visual Web Developer to work. What if I was for instance
using a text editor to do this web, would it then be impossible without
precompiling the .cs code in command-line?!
"news.microsoft.com" <db****@simnet.is> wrote in message
news:OK**************@TK2MSFTNGP15.phx.gbl...
sorry my mistake, it is Inherits="TemplateTopCB" in the code - so this is
not the cause of the error!
"Bill Borg" <Bi******@discussions.microsoft.com> wrote in message
news:10**********************************@microsof t.com... Is it that your class name (w/CB) does not match "inherits="?
"news.microsoft.com" wrote:
Getting really frustrated, I've been trying for 6 hours now! Got this
very
simple web app having a main .aspx page which has a user control (added
with
the Register directive) and the TemplateTop.ascx wich works 100% until I
try
adding codebehind, eg;
<%@ Control Codebehind="TemplateTop.ascx.cs" Inherits="TemplateTop" %>
And in the TemplateTop.ascx.cs file:
using ...
public class TemplateTopCB : UserControl
{
public Literal MyLiteral1;
void Page_Load(object sender, System.EventArgs e)
{
MyLiteral1.Text = "success!";
}
}
The error is:
Parser Error Message: Could not load type 'TemplateTopCB'.