首页 > 开发 > 综合 > 正文

Calling a Button Event from a Compiled DLL

2024-07-21 02:16:38
字体:
来源:转载
供稿:网友
'the inherits line calls the namespace.class inside the dll
<%@ page language="vb" inherits="aspfrees.mycodebehind" %>

<html>
<head>
<title>calling a button event from a compiled dll</title>
</head>
<body>
   <form runat="server">
    <asp:button id="btnwhatsnew" text="add whats new" onclick="b1_click" runat="server" />
</form>
</body>
</html>

  
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 will place the dll in the /bin directory)

this creates an 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

中国最大的web开发资源网站及技术社区,
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表