Calling a Button Event from a Compiled DLL

Source: Internet
Author: User
' The Inherits line calls the Namespace.class inside the DLL
<%@ Page language= "VB" inherits= "Aspfrees.mycodebehind"%>

<title>calling a Button Event from a compiled dll</title>
<body>
<form runat= "Server" >
<asp:button id= "btnwhatsnew" text= "Add Whats new" onclick= "B1_click" runat= "Server"/>
</form>
</body>


Source VB File that gets compiled
Cpdll.vb file



Option Strict off

Imports System
Imports System.DateTime
Imports System.Globalization
Imports System.Data
Imports System.Data.SQL
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls

Namespace aspfrees


Public Class mycodebehind:inherits Page

Public Sub B1_click (sender as Object, E as System.EventArgs)
Dim value1 As String = "WOW the button was clicked!"
Response.Write (value1)
End Sub


End Class
End Namespace



Batch File to compile the DLL (this'll place the DLL in The/bin directory)

This creates a aspfree.dll into the bin directory!
Mk.bat file to compile the. vb file

Vbc/t:library/out:.. \bin\aspfreebuttoneventdll.dll/r:system.web.dll/r:system.dll
/r:system.data.dll Cpdll.vb



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.