473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using classes in an ASPX page.

Hi all,

I need to use an helper class in my ASP.NET page. I want to use it in the
actual ASPX page and not in the code behind class.
For doing so I obviously need to import the package containing that helper
class in the ASPX page. For a normal C# class I can do the following :

using Com.MyCompany.M yNameSpace

How can I achieve the "using" feature in a ASPX page ?

Is there any specific keyword to use in the <% @Page %> directive? I did not
see any in the reference as well as I cannot see any specific directive that
would answer to my need.

Thanks for any help

Francois
Nov 18 '05 #1
1 1235
Yes, you can add an assembly using <%@ Assembly Name="MyAssembl y" %> or, as
a default, if you have in machine.config file the entry <add assembly="*" />
just put the assembly in the bin folder.
The directive <%@ Import namespace="valu e" %> import only the namespace.

HtH,
Andrea

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"francois" <fr******@betti nghouses.com_NO SPAM> wrote in message
news:uc******** ******@TK2MSFTN GP09.phx.gbl...
Hi all,

I need to use an helper class in my ASP.NET page. I want to use it in the
actual ASPX page and not in the code behind class.
For doing so I obviously need to import the package containing that helper
class in the ASPX page. For a normal C# class I can do the following :

using Com.MyCompany.M yNameSpace

How can I achieve the "using" feature in a ASPX page ?

Is there any specific keyword to use in the <% @Page %> directive? I did not see any in the reference as well as I cannot see any specific directive that would answer to my need.

Thanks for any help

Francois

Nov 18 '05 #2

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

Similar topics

6
4807
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and...
43
2599
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the User first hits Internet Explorer 6.0 on your browser.
1
1633
by: Stephen Adam | last post by:
Hi there, I've just started a c# project at work where I cannot use Visual Studio. I am trying to pass variables from one form to another. When I try to create an instance of the sending class in the receiving class I get a "The type or namespace name 'XXXX' could not be found (are you missing a using directive or an assembly reference?)" ...
3
1475
by: Adrian | last post by:
Hi All, I am a big fan of the Codebehind model. I would like to continue to keep my .ASPX pages FREE of any 'LOGIC' and keep it PURE 'HTML'. I would like to know how many of you handle the following situation. (In pseudo code to illustrate my point) <html> <body> if (condition)
4
2486
by: Vladimír Kolesnik | last post by:
Hi there, does anybody know, how to create a class, which is can be inherited by both aspx (System.Web.UI.Page) as well as by ascx (System.Web.UI.UserControl) classes. I have the bunch of same methods, which I want to reuse in both ascx and aspx classes. Any idea how to do it? Thanks for all your hints.
15
4733
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is...
10
2417
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and load as a 3rd partial class. This would be handy so i can generate standard code into one of the partial classes, while having my custom code...
9
5771
by: Fat Elvis | last post by:
I'd like to extend some of my Asp.net pages by using Partial Classes. Example ASP.Net Page: public partial class Admin_Customer : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Data_List(); } }
0
7700
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...
0
7924
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. ...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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...
0
3653
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...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
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.