How do we use class instead of components in ASP+
/*
Tofu production is all boutique
http://www.asp888.net Tofu Technology Station
If you repost this article, please keep copyright information
More articles are at the Tofu Technology Station
*/
In ASP+, we have a way to use the code of pre-related (Pre-Release) instead of the component of the binary code that has been compiled
Let's take a look at an example
You may use the following code:
< %@ assembly src = test.cs %> // compile C# class
< %@ assembly src = test.vb %> // compile vb class
At the top of the code, we use this code to tell the compiler to compile the class contained in the file to the page of ASP+
test.cs:
public class myclass {
Public String Saysomething () {
Return tofu is made of boutique;
}
}
test.vb:
public class test
Readonly Property Saysomething () as String
get
Saysomething = Tofu making is all boutique
end get
End Property
end class
test.aspx:
< %@ assembly src = test.vb %>
<html>
<script language = vb runat = server>
sub page_load (SENDER As Object, E as eventArgs)
DIM TEMP As New Test
lblmsg.text = TMP.SAYSOMETHING ()
end sub
</script>
<body>
<asp: label id = lblmsg runat = server/>
</body>
</html>