473,782 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

import of dynamic class file

Hello?

On the ASP.NET, I can use the class by import declation on the top of page.

<%@ page language="vb" explicit="true" aspcompat="fals e" debug="true"%>
<%@ import namespace="Syst em.Data" %>
<%@ import namespace="Syst em.Data.SqlClie nt" %>

It's work well for the compiled class files in /bin folder.

But, I have a problem on using class file which are not complied.
How can I import or include it to asp.net source code?

For example. I have two class files written in vb.net.

student.aspx.vb
<script language="vb" runat="server">
public class Student
....
end class
</script>

teacher.aspx.vb
<script language="vb" runat="server">
public class Teacher
....
end class
</script>

If I try to include both class file to asp.net code.

<!-- #include file="student.a spx.vb" -->
<!-- #include file="teacher.a spx.vb" -->

It occur error that the definition of class was not founded on running.
If I merge the classfile to one file. then, It work well.
Is there are any method to use indivisual files on asp.net?

Hope for your kindly reply.

Thanks!

Nov 18 '05 #1
2 3377
Hello,

You can use the @ Reference Directive in ASP.Net.
From the German .Net Framework Documentation:

<%@ Reference page | control="pathto file" %>

Attribute
Page
Die Web Forms-Seite, die von ASP.NET zur Laufzeit dynamisch
kompiliert und mit der aktuellen Seite verknüpft werden soll.
Control
Das Benutzersteuere lement, das von ASP.NET zur Laufzeit dynamisch
kompiliert und mit der aktuellen Seite verknüpft werden soll.
C#]
<%@ Reference Control="MyCont rol.ascx" %>
<script language="C#" runat=server>

void Page_Load(Objec t sender, EventArgs e) {

// In the @ Control directive in the MyControl.ascx file,
// you must include classname="MyCo ntrol" for this to work.
MyControl myControl = (MyControl)
Page.LoadContro l("MyControl.as cx");
myControl.MyPro perty = "Color";

PlaceHolder.Con trols.Add(myCon trol);
}

</script>

<html>
<body>
<asp:placeholde r id="PlaceHolder " runat=server/>
</body>
</html>
Hope this helps!
schorsch

On Thu, 3 Jun 2004 19:11:26 +0900, "s.hong" <s.****@spamxxx .com>
wrote:
Hello?

On the ASP.NET, I can use the class by import declation on the top of page.

<%@ page language="vb" explicit="true" aspcompat="fals e" debug="true"%>
<%@ import namespace="Syst em.Data" %>
<%@ import namespace="Syst em.Data.SqlClie nt" %>

It's work well for the compiled class files in /bin folder.

But, I have a problem on using class file which are not complied.
How can I import or include it to asp.net source code?

For example. I have two class files written in vb.net.

student.aspx.v b
<script language="vb" runat="server">
public class Student
....
end class
</script>

teacher.aspx.v b
<script language="vb" runat="server">
public class Teacher
....
end class
</script>

If I try to include both class file to asp.net code.

<!-- #include file="student.a spx.vb" -->
<!-- #include file="teacher.a spx.vb" -->

It occur error that the definition of class was not founded on running.
If I merge the classfile to one file. then, It work well.
Is there are any method to use indivisual files on asp.net?

Hope for your kindly reply.

Thanks!


Nov 18 '05 #2
Thanks Karl,

I succeed to use the class files on my asp.net page.
But, It's needed to generate ascx files for each class file to use
@Reference derective.

Thank you very much!

"Karl Bauer" <sc********@yah oo.de> wrote in message
news:0b******** *************** *********@4ax.c om...
Hello,

You can use the @ Reference Directive in ASP.Net.
From the German .Net Framework Documentation:

<%@ Reference page | control="pathto file" %>

Attribute
Page
Die Web Forms-Seite, die von ASP.NET zur Laufzeit dynamisch
kompiliert und mit der aktuellen Seite verknüpft werden soll.
Control
Das Benutzersteuere lement, das von ASP.NET zur Laufzeit dynamisch
kompiliert und mit der aktuellen Seite verknüpft werden soll.
C#]
<%@ Reference Control="MyCont rol.ascx" %>
<script language="C#" runat=server>

void Page_Load(Objec t sender, EventArgs e) {

// In the @ Control directive in the MyControl.ascx file,
// you must include classname="MyCo ntrol" for this to work.
MyControl myControl = (MyControl)
Page.LoadContro l("MyControl.as cx");
myControl.MyPro perty = "Color";

PlaceHolder.Con trols.Add(myCon trol);
}

</script>

<html>
<body>
<asp:placeholde r id="PlaceHolder " runat=server/>
</body>
</html>
Hope this helps!
schorsch

On Thu, 3 Jun 2004 19:11:26 +0900, "s.hong" <s.****@spamxxx .com>
wrote:
Hello?

On the ASP.NET, I can use the class by import declation on the top of page.
<%@ page language="vb" explicit="true" aspcompat="fals e" debug="true"%>
<%@ import namespace="Syst em.Data" %>
<%@ import namespace="Syst em.Data.SqlClie nt" %>

It's work well for the compiled class files in /bin folder.

But, I have a problem on using class file which are not complied.
How can I import or include it to asp.net source code?

For example. I have two class files written in vb.net.

student.aspx.v b
<script language="vb" runat="server">
public class Student
....
end class
</script>

teacher.aspx.v b
<script language="vb" runat="server">
public class Teacher
....
end class
</script>

If I try to include both class file to asp.net code.

<!-- #include file="student.a spx.vb" -->
<!-- #include file="teacher.a spx.vb" -->

It occur error that the definition of class was not founded on running.
If I merge the classfile to one file. then, It work well.
Is there are any method to use indivisual files on asp.net?

Hope for your kindly reply.

Thanks!


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
8912
by: bry | last post by:
Hi, I'm trying to do a dynamic import of a file that has no problems with it, that is to say I can import it normally, my sys.path is set to the right folder etc. but my dynamic import code is not working, this is the problem code: try: import f except: print "not importable"
4
2196
by: MackS | last post by:
Hi I'm new to Python, I've read the FAQ but still can't get the following simple example working: # file main_mod.py: global_string = 'abc' def main():
2
3096
by: Tian | last post by:
I am writing a python program which needs to support some plug-ins. I have an XML file storing some dynamic structures. XML file records some class names whose instance needs to be created in the run time while parsing the XML file. I wonder what is the best solution for this problem? I also have some problem about the "import". How should I design my packages? Say, I have all code locates at c:\projects\sami, "c:\project" is in my...
0
2727
by: Bill Davy | last post by:
I am working with MSVC6 on Windows XP. I have created an MSVC project called SHIP I have a file SHIP.i with "%module SHIP" as the first line (file is below). I run SHIP.i through SWIG 1.3.24 to obtain SHIP_wrap.cpp and SHIP.py; the latter contains the line "import _SHIP". I compile SHIP_wrap.cpp and a bunch of files into a DLL which I have the
16
3116
by: didier.doussaud | last post by:
I have a stange side effect in my project : in my project I need to write "gobal" to use global symbol : .... import math .... def f() : global math # necessary ?????? else next line generate an error message ?????
7
22498
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not working under the 2.0 framework. I see in the Reference.cs file under the web service reference the...
7
12265
by: Pete | last post by:
I need to import multiple tab delimited files for which I do not have the formats. All files have column headers in the the line. The files must be dynamic. The only common value is that the files are text and use tabs to delimit the column data. I can not use the File/Import as people using the program do not have the necessary experience to perform this function. Therefore, I need to programtically create unique tables for each...
49
3948
by: Martin Unsal | last post by:
I'm using Python for what is becoming a sizeable project and I'm already running into problems organizing code and importing packages. I feel like the Python package system, in particular the isomorphism between filesystem and namespace, doesn't seem very well suited for big projects. However, I might not really understand the Pythonic way. I'm not sure if I have a specific question here, just a general plea for advice. 1) Namespace....
7
2155
by: bambam | last post by:
import works in the main section of the module, but does not work as I hoped when run inside a function. That is, the modules import correctly, but are not visible to the enclosing (global) scope. Questions: (1) Where can I read an explanation of this? (2) Is there a work around?
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.