Solved

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

Posted on 2004-04-13
1
318 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now