|
Hello,
I'm working on a CodeBehing paradigm to generate .aspx files.
Ok I know, I use directives like this:
<%@ Page language="c#" src="CodeBehind1a.aspx.cs" AutoEventWireup="false" Inherits="Project.CodeBehind" %>
and everything is ok, since I can Instantiate objects from the class located at CodeBehind1a.aspx.cs since it's in the "src" attribute
But if i want to instantiate objects from a second class located at, let me say called, CodeBehind1b.aspx.cs, but doing it (instantiate the object) inside the CodeBehind1a.aspx.cs for example? How can this be done?
For example, suppose that I have a .aspx file with this directive:
***********************************************************
// Namespace: Project, Class: CodeBehind
<%@ Page language="c#" src="CodeBehind1a.aspx.cs" AutoEventWireup="false" Inherits="Project.CodeBehind" %>
// Namespace: Projec2, Class: Codebehind2
<%@ Assembly src="CodeBehind1b.aspx.cs" %>
<%@ Import Namespace="Project2" %>
***********************************************************
I want to access the classes from both .aspx.cs files
Now inside the file CodeBehind1a.aspx.cs I try to instantiate
a object from CodeBehind1b.aspx.cs like this:
***********************************************************
Project2.CodeBehind2 b2 = new Project2.CodeBehind2();
***********************************************************
and get the error:
CS0246: The type or namespace name 'Project2' could not be found (are you missing a using directive or an assembly reference?)
What's Wrong, since I used the Assembly and Import Directive into .aspx file? I have tried to use it inside CodeBehind1a.aspx.cs:
using Project2;
But nothing...
Does someone can receive my code via mail for future check??
Thanks,
Sthefan Berwanger
|
|
|
|
|
|
|
// |