Welcome to the myhosting.com Forums.
I've been at this awhile but one item that has always stumped me is the "registering of components". I recently downloaded a trial ASP component from Chestysoft. This is a component that allows website visitors to select a number of files to download and then nicely wraps up those files into a zip file. That's all cool! I've placed the .dll component in my bin folder, uploaded it, but with no success.
Here's the error that get's kicked back:
Server Error in '/' Application.
Could not create an object of type 'csASPZipFileTrial.MakeZip'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Could not create an object of type 'csASPZipFileTrial.MakeZip'.
Line 13: Dim I
Line 15: FileObj = Server.CreateObject("csASPZipFileTrial.MakeZip")
Line 17: FileObj.DirName = FileObj.CurrentDir & "../drawings/greengrid/acrobat/"
I've included the code below. Any ideas?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Select the files for download</p>
<form action=makezip.asp method=post>
Set FileObj = Server.CreateObject("csASPZipFileTrial.MakeZip")
FileObj.DirName = FileObj.CurrentDir & "datafiles\"
If FileObj.FileList.Count > 1 Then
For I = 0 to FileObj.FileList.Count - 1
Response.Write "<input type=checkbox value=true name=" & I & ">" & FileObj.FileList(I) & "
<input type=hidden name=directory value="<%= Server.HTMLEncode(FileObj.DirName) %>">
<input type=reset value=Clear><input type=submit value=Download>
Re: Registering Components
This is definately beyond my abilities, but I had one of our developers look at it and this is what he suggests.
Hope this helps!
In Visual Studio add a reference to the csASPZipFileTrial.dll file. Right click on the project and select “Add Reference”. Then click the Browse tab and browse to csASPZipFileTrial.dll. You will then get a file called Interop.csASPZipFileTrial.dll in the bin
folder. You will be able to use the component on any aspx page in the following way:
Dim FileObj As New csASPZipFileTrial.MakeZip
FileObj.DirName = "e:\Inetpub\Clients\mysite.com\datafiles"