Referencing Dll has to be done by 2 steps.
Step1: Add the DLL in the References
From the Solution explorer , right click on the references, add the dll ....., select the dll file. The files will be in the
Step2: Include the Namespace in your aspx.
Goto Code behind of the ASPX page.add the following code at top.
Then use the class in your aspx page.
Dim myClass as New <ClassName>
Hope this helps. Let me know.
I'm almost there. I just think I might have typed something in wrong. I tried you first suggest by taking out the src="" tag from the directive and placing the complied dll in the bin folder. The asp.net complains that it can't load type WebForm1..
this is the new directive that I provided with the dll in the bin directory.
but I get the same error.
PS. If it could help i could post or send you a zip file of my folder layout and files.
but that doesn't solve my problem.
I can complie the webform1.aspx.vb into a dll using the following
vbc /t:library /r:test.dll WebForm1.aspx.vb /r:system.dll /r:system.web.dll
but then how do get my WebForm1.aspx to point to this dll. It still
refernce the WebForm1.aspx.vb page not the dll. I think it has somehting to
do with the first line.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<form id="Form1" method="post" runat="server">
<asp:button id="Button1" style="Z-INDEX: 101; LEFT: 228px; POSITION:
absolute; TOP: 55px" runat="server" Width="117px" Height="40px"
</asp:button><asp:label id="Label1" style="Z-INDEX: 102; LEFT: 374px;
POSITION: absolute; TOP: 56px" runat="server" Width="135px"
thanks.. hope you can help
When you compile the WebForm1.aspx.vb add a /r:Test.dll switch.
I have created a simple aspx.vb file as a code behind page in which I
to refencre a dll i created. But upon compliation by ASP.NET it can't
find my dll. I have to add a refence to this some how. It visual studio
you can simple add a refence to the dll. It mine case i'm doing this
through command line compliers and notepad. Can anybody tell me how to
my aspx.vb file to succeffuly complie so it will reference my dll
I have attached the code.
To complie the Test.dll you can use this from the command prompt
vbc /t:library Test.vb
Public Class WebForm1
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim obj As Test.TestClass
Me.Label1.Text = obj.say()
Public Class TestClass
Function SayHi() As String