Using Assembly in ASP.NET – Simplest Example

This example demonstrates the simplest method for using a .NET assembly in an ASP.NET web page.

1) Create a new file “helloWorld.aspx” in your web site’s root directory. Using a text editor, add this:

<%@ Page Language="C#" %>
<%@ Import Namespace="Chilkat" %>

<html>
<head>
<title>ASP.NET Hello World</title>
</head>
<body bgcolor="#FFFFFF">

<p>
<%
	Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
	Response.Write(ftp.Version);
%>
</p>

</body>
</html>

2) Create a “bin” directory in the same directory where the helloWorld.aspx file is located.

3) Copy the managed assembly (in this case it is ChilkatDotNet2.dll) into the “bin” directory.

4) That’s it. Browse to http://www.yourwebsite.com/helloWorld.aspx. The time to load the first page hit will be significantly longer than subsequent page loads. Errors are most likely permission related. Feel free to send error listings to support@chilkatsoft.com