欢迎光临
我们一直在努力

Calling a Button Event from a Compiled DLL-.NET教程,Asp.Net开发

建站超值云服务器,限时71元/月

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

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » Calling a Button Event from a Compiled DLL-.NET教程,Asp.Net开发
分享到: 更多 (0)