Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Class Files without Compile

Status
Not open for further replies.

jkelly295

MIS
Aug 14, 2001
15
US
Basically I have three pages Page1.asp,Page1.aspx.vb, LogTransactions.vb. Notice that I am using the src attribute in the aspx page so I don't have to compile/build the project everytime I make a change to the page. That's all good .. but how do I access the class inside the LogTransactions.vb page WITHOUT having to compile the LogTransactions.vb to a dll and placing it in the /BIN folder. I had tried the <%@ Assembly Src="LogTransactions.vb" %> in the Page1.aspx file but that did not seem to work. Is there anyway to get this to work?

Page1.aspx
<%@ Page Language="vb" AutoEventWireup="false" src="Page1.aspx.vb" Inherits="Page1"%>
<html>
<head>
<form>
<!--Stuff in here-->
</form>
</head>
</html>



Page1.aspx.vb
Public Class Page1
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

LogTransactions.LogTransaction(UserID, "LookAtADoc")

end sub
end class


LogTransactions.vb
Public Class LogTransactions
Public Shared Function LogTransaction(ByVal sUserid As String, ByVal sTransaction As String)
'Simple Insert INTO DB
end function
end class
 
Well it helps if you provide the correct path...

I added this to the Page1.aspx

<%@ Assembly Src="/Components/Logging/LogTransactions.vb" %>


It seems to work now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top