Welcome to the myhosting.com Forums.
-
Registering Components
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'.
Source Error:
Line 13: Dim I
Line 14:
Line 15: FileObj = Server.CreateObject("csASPZipFileTrial.MakeZip")
Line 16:
Line 17: FileObj.DirName = FileObj.CurrentDir & "../drawings/greengrid/acrobat/"
I've included the code below. Any ideas?
Steve
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
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) & "
"
Next
End If
%>
<input type=hidden name=directory value="<%= Server.HTMLEncode(FileObj.DirName) %>">
<input type=reset value=Clear><input type=submit value=Download>
</form>
</body>
</html>
-
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.
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:
Code:
Dim FileObj As New csASPZipFileTrial.MakeZip
FileObj.DirName = "e:\Inetpub\Clients\mysite.com\datafiles"
Hope this helps!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Version 4.1.7
Copyright ©2000 - 2013
All times are GMT -4. The time now is 06:53 PM.