Solved

How to use custom utility classes in Asp.net and C#

Posted on 2004-04-13
1
326 Views
Last Modified: 2006-11-17
Hi,
I am a newbie to .net.   I am developing a small app with asp.net and C#.   I am NOT using visual studio.net.  

My question is:  I would like to write a small utility class with application wide functions.  All the C# files so far have been compiled from aspx.  Should I compile this util class into a .dll?  Please give me a good example / link of how to compile and bind custom c# classes to an aspx page

thanks,
sk

0
Comment
Question by:skotamraju
1 Comment
 
LVL 15

Accepted Solution

by:
OMC2000 earned 500 total points
ID: 10812082
yes, you shuld compile utility class(es) into an assembly  .DLL. Then you'll be able to use them in your code behind .cs files or at server scripts as standard .NET classes. You should add

using assembly_name

line to your code code behind files (.aspx.cs).

And add

<%@ Import Namespace="aseemply_name" %>

to .ASPX files

You could look at

Microsoft.NET\Framework\SDK\Samples\Quickstart\aspplus\samples\webforms\busobjs

on your computer.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question