Nidhinkoroth
New Member
I have a .vb file with classes and a normal .aspx file. I want to use the classes from the .vb file in my .aspx file. <BR><BR>here's what i tried :<BR><BR>my stuff.vb file look like this :<BR><BR>-----------------------------------<BR>Imports System.Data<BR>Imports System.Data.OleDb<BR>Imports System.Data.SqlClient<BR><BR>Namespace clsDb<BR><BR> Public Class dbshortcuts<BR><BR> Public Sub connectToDb()<BR><BR> ...<BR><BR> End Sub<BR><BR> End Class<BR><BR>End Namespace<BR><BR>---------------------------------------<BR><BR><BR>my file.aspx :<BR><BR>-----------------------<BR><BR><%@ Page Language="VB" ... %><BR><%@Import NameSpace="clsDb" %><BR><BR><script runat="server"><BR> Sub Page_Load(Sender As Object, E As EventArgs) <BR> 'Here i want to use the classes in the stuff.vb file<BR> End Sub<BR></script><BR>....<BR>-----------------------<BR><BR>The compiler make a error at the Import command in the file.aspx.<BR>Any idea?Did you compile the vb file as a library and add it to the bin directory of the application?are you making sure you're putting the compiled .dll file in the application's /bin/ directory?Hum... how am i supposed to do that?beat me by a minute and a half...Are you using VS??to compile a .vb file, you need to use the vbc compiler. at the command line, try this...<BR><BR>vbc /t:library /r:System.dll /r:System.Data.dll /out:C:InetpubwwwrootinNameOfCompiledDll.dll C
ath to your vb fileYes, i'm using vs. It's just in the Build menu, no big deal. Thanx for pointing me in the good direction. I was about to throw my computer through the window. 

