Solved

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

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

Suggested Solutions

Title # Comments Views Activity
Need help on C# Linq query on object 6 62
ASP.NET 5 Templates 2 78
How useful is the free version of Selenium? 3 34
Powershell File Sort 8 29
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…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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