Is the Page directive only go on ".aspx" pages? I think the answer is yes,
but I am not positive. I am trying to figure out why a called class can not
be found and I was wondering if I should place a page directive on the class
which I am trying to call.
In my situation I have "MyPage.aspx" which has code behind page called
"MyPage.aspx.vb" and "MyPage.aspx.vb" instatiates "Myclass.vb" and the
"MyClass.vb" can not be found. All my code is source code, not compiled code,
so I am using the page directive of @Page Inherits="MyPage"
src="MyPage.aspx.vb". When "MyPage.aspx.vb" instatiates "MyClass.vb" it fails
with a compile error.
I have taken the "MyClass.vb" and created a new project and compiled the code
as a new project and placed that dll into the bin folder, but then I get an
error of "Invalid Type" when the class is instatiated.
I have tried using the @Assembly directive of @Assembly src="MyClass.vb", but
this has no effect.
How can I resolve this error allowing the source code to be compiled on the
fly? 5 1424
First, yes, the page directive is only good in ASPX pages. Second, you can't
reference code behind pages from other code behind pages without compiling
them. You either have to put all of that code in one file or you have to
write it so it doesn't reference each other. Or you have to compile all but
one and put the compiled code in the /bin directory.
Jerry
"Jim Heavey" <Ji*******@hotmail.com> wrote in message
news:OL**************@tk2msftngp13.phx.gbl... Is the Page directive only go on ".aspx" pages? I think the answer is
yes, but I am not positive. I am trying to figure out why a called class can
not be found and I was wondering if I should place a page directive on the
class which I am trying to call.
In my situation I have "MyPage.aspx" which has code behind page called "MyPage.aspx.vb" and "MyPage.aspx.vb" instatiates "Myclass.vb" and the "MyClass.vb" can not be found. All my code is source code, not compiled
code, so I am using the page directive of @Page Inherits="MyPage" src="MyPage.aspx.vb". When "MyPage.aspx.vb" instatiates "MyClass.vb" it
fails with a compile error.
I have taken the "MyClass.vb" and created a new project and compiled the
code as a new project and placed that dll into the bin folder, but then I get
an error of "Invalid Type" when the class is instatiated.
I have tried using the @Assembly directive of @Assembly src="MyClass.vb",
but this has no effect.
How can I resolve this error allowing the source code to be compiled on
the fly?
Then what is the purpose of the "<%@ Assembly" directive?
That directive allows you to link together application and
it as a "src=" option which seems to imply that you can
have strait source rather then compiled code.
Am I missing something? -----Original Message----- First, yes, the page directive is only good in ASPX
pages. Second, you can'treference code behind pages from other code behind pages
without compilingthem. You either have to put all of that code in one file
or you have towrite it so it doesn't reference each other. Or you have
to compile all butone and put the compiled code in the /bin directory.
Jerry
"Jim Heavey" <Ji*******@hotmail.com> wrote in message news:OL**************@tk2msftngp13.phx.gbl... Is the Page directive only go on ".aspx" pages? I
think the answer isyes, but I am not positive. I am trying to figure out why a
called class cannot be found and I was wondering if I should place a page
directive on theclass which I am trying to call.
In my situation I have "MyPage.aspx" which has code
behind page called "MyPage.aspx.vb" and "MyPage.aspx.vb"
instatiates "Myclass.vb" and the "MyClass.vb" can not be found. All my code is source
code, not compiledcode, so I am using the page directive of @Page
Inherits="MyPage" src="MyPage.aspx.vb". When "MyPage.aspx.vb"
instatiates "MyClass.vb" itfails with a compile error.
I have taken the "MyClass.vb" and created a new project
and compiled thecode as a new project and placed that dll into the bin
folder, but then I getan error of "Invalid Type" when the class is instatiated.
I have tried using the @Assembly directive of @Assembly
src="MyClass.vb",but this has no effect.
How can I resolve this error allowing the source code
to be compiled onthe fly?
.
You're missing the fact that the assembly will only be visible in the page
that contains the directive, but not in other assemblies you include in the
same page. To have the assemblies see each other you have to compile them
and use Using Assembly.Name (in C#) within the assembly files.
Jerry
"Jim Heavey" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl... Then what is the purpose of the "<%@ Assembly" directive? That directive allows you to link together application and it as a "src=" option which seems to imply that you can have strait source rather then compiled code.
Am I missing something?-----Original Message----- First, yes, the page directive is only good in ASPX pages. Second, you can'treference code behind pages from other code behind pages without compilingthem. You either have to put all of that code in one file or you have towrite it so it doesn't reference each other. Or you have to compile all butone and put the compiled code in the /bin directory.
Jerry
"Jim Heavey" <Ji*******@hotmail.com> wrote in message news:OL**************@tk2msftngp13.phx.gbl... Is the Page directive only go on ".aspx" pages? I think the answer isyes, but I am not positive. I am trying to figure out why a called class cannot be found and I was wondering if I should place a page directive on theclass which I am trying to call.
In my situation I have "MyPage.aspx" which has code behind page called "MyPage.aspx.vb" and "MyPage.aspx.vb" instatiates "Myclass.vb" and the "MyClass.vb" can not be found. All my code is source code, not compiledcode, so I am using the page directive of @Page Inherits="MyPage" src="MyPage.aspx.vb". When "MyPage.aspx.vb" instatiates "MyClass.vb" itfails with a compile error.
I have taken the "MyClass.vb" and created a new project and compiled thecode as a new project and placed that dll into the bin folder, but then I getan error of "Invalid Type" when the class is instatiated.
I have tried using the @Assembly directive of @Assembly src="MyClass.vb",but this has no effect.
How can I resolve this error allowing the source code to be compiled onthe fly?
.
I hope I understood you question correctly. To use the class, you will
have to Import the namespace that the class is in. If the class is in a
DLL then you will have to add it to the references of the project.
Jalil Vaidya
Jim Heavey wrote: Is the Page directive only go on ".aspx" pages? I think the answer is yes, but I am not positive. I am trying to figure out why a called class can not be found and I was wondering if I should place a page directive on the class which I am trying to call.
In my situation I have "MyPage.aspx" which has code behind page called "MyPage.aspx.vb" and "MyPage.aspx.vb" instatiates "Myclass.vb" and the "MyClass.vb" can not be found. All my code is source code, not compiled code, so I am using the page directive of @Page Inherits="MyPage" src="MyPage.aspx.vb". When "MyPage.aspx.vb" instatiates "MyClass.vb" it fails with a compile error.
I have taken the "MyClass.vb" and created a new project and compiled the code as a new project and placed that dll into the bin folder, but then I get an error of "Invalid Type" when the class is instatiated.
I have tried using the @Assembly directive of @Assembly src="MyClass.vb", but this has no effect.
How can I resolve this error allowing the source code to be compiled on the fly?
I hope I understood you question correctly. To use the class, you will
have to Import the namespace that the class is in. If the class is in a
DLL then you will have to add it to the references of the project.
Jalil Vaidya
Jim Heavey wrote: Is the Page directive only go on ".aspx" pages? I think the answer is yes, but I am not positive. I am trying to figure out why a called class can not be found and I was wondering if I should place a page directive on the class which I am trying to call.
In my situation I have "MyPage.aspx" which has code behind page called "MyPage.aspx.vb" and "MyPage.aspx.vb" instatiates "Myclass.vb" and the "MyClass.vb" can not be found. All my code is source code, not compiled code, so I am using the page directive of @Page Inherits="MyPage" src="MyPage.aspx.vb". When "MyPage.aspx.vb" instatiates "MyClass.vb" it fails with a compile error.
I have taken the "MyClass.vb" and created a new project and compiled the code as a new project and placed that dll into the bin folder, but then I get an error of "Invalid Type" when the class is instatiated.
I have tried using the @Assembly directive of @Assembly src="MyClass.vb", but this has no effect.
How can I resolve this error allowing the source code to be compiled on the fly?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rainbow News Service |
last post by:
http://www.php.net/manual/en/install.windows.manual.php says:
Copy your chosen ini-file to a directory that PHP is able to find and
rename it to php.ini. PHP searches for php.ini in the following...
|
by: Retlak |
last post by:
The recommended (on dozens of websites) and effective (works in
Netscape, MSIE, Mozilla, probably others) way to detect if a browser
has Javascript turned off is to put this in the <head>:
...
|
by: jbeerni |
last post by:
In .NET, you can mark methods and accessors as obsolete by using the
directive.
I've found some interesting behavior with the directive when used in a class
which is referenced as a return type...
|
by: trying_to_learn |
last post by:
im in the primary stages of learning C++. The book im learning from says
Dont use using namespace.. directive in header file
However im trying to make the following header file.I need to include...
|
by: Mantorok Redgormor |
last post by:
what is the purpose of the #line directive?
how is it suppose to be used?
I didn't see it mentioned in the faq and I can't make any sense of it from
the standard.
--
nethlek
|
by: rjack |
last post by:
I'm using VS 2005 Beta 2.
In VS 2003, the Page directive in an aspx page has Language and
CodeBehind attributes. You can have the language be different than the
code behind file language. For...
|
by: Poppy |
last post by:
I opened an asp page in VS.net 2002 and then saved it as an aspx page.
I was prompted if I wanted to create the class file for the page and clicked
yes.
Now when I try and open the page I get...
|
by: Francois Grieu |
last post by:
One of the C compiler that I use <OT>(Keil's CX51)</OTbarks at
#define a(b) b
int main(void){return a(
#if 0
#endif
0);}
More generally, this compiler seems confused by any preprocessing...
|
by: aleemakhtar1 |
last post by:
wat is use of pragma directive in embedded sys ??
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |