DLL调用的问题 ASP.net最大特点就是不用注册DLL也可调用,调用方法如:dim dlldll=Server.CreateObject("dllname.myclass")dll.yousub()应该是这样吧,如有错请指出,因为我也是刚学asp.net 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我原来是.cs文件有一个myClass类;在.aspx中引用:<%@ Page Src="myClass.cs" Inherits="myClass" %>能够通过但将.cs文件编译为DLL文件后想用<%@ Import namespace="myClass" %>(beta1版的教程好象都这样引用)进行引用,但出错,说不能识别myClass;我想知道Beta2版或正式版调用的方法,非常感谢! <% @ Register TagPrefix="dllname" Namespace="dllname" Assembly="dllname" %> 详细如下:编译的文件名,必须与控件中namespace的名字一致。例如using System;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace SampleControls { public class Composition2 : Control, INamingContainer { }}csc /t:library /out:SampleControls.dll /r:System.Web.dll Composition2.cs编译后直接考到bin目录。或者csc /t:library /out:./bin/SampleControls.dll /r:System.Web.dll Composition2.cs然后在*.aspx里这样使用<%@ Page Language="C#" %><%@ Register TagPrefix="SampleControls" Namespace="SampleControls" Assembly="SampleControls" %><html><body><form method="POST" action="Composition2.aspx" runat="server" ID="Form1"> <SampleControls:Composition2 id="MyControl" runat="server" /></form></body></html> 简单的问题 asp.net 导出word 出错 文件上传大小,谁来帮帮我? string 怎么转类型 access 的自动编号 网站上传上去出现这个问题~大家帮帮忙! GridView中的CheckBox用Javascript全選出錯(ASP.NET) JS文件中怎么设置本地的文件啊 为什么只能设置网络的文件啊? 想问一下关于DataSet的构造函数的问题 不能锁定文件,为什么啊? ****高分求助!! 可以通过一个.aspx中的控件来控制另一个.aspx中的一个控件的属性吗? 在XP中怎样配置IIS才能调试aspx文件,有这样的文章吗? 请问:如何删除TreeView中所选取的节点呢?
在.aspx中引用:
<%@ Page Src="myClass.cs" Inherits="myClass" %>
能够通过但将.cs文件编译为DLL文件后
想用<%@ Import namespace="myClass" %>(beta1版的教程好象都这样引用)
进行引用,但出错,说不能识别myClass;
我想知道Beta2版或正式版调用的方法,非常感谢!
<% @ Register TagPrefix="dllname" Namespace="dllname" Assembly="dllname" %>
编译的文件名,必须与控件中namespace的名字一致。例如using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;namespace SampleControls
{ public class Composition2 : Control, INamingContainer
{
}
}csc /t:library /out:SampleControls.dll /r:System.Web.dll Composition2.cs
编译后直接考到bin目录。或者
csc /t:library /out:./bin/SampleControls.dll /r:System.Web.dll Composition2.cs然后在*.aspx里这样使用
<%@ Page Language="C#" %>
<%@ Register TagPrefix="SampleControls" Namespace="SampleControls" Assembly="SampleControls" %>
<html>
<body>
<form method="POST" action="Composition2.aspx" runat="server" ID="Form1">
<SampleControls:Composition2 id="MyControl" runat="server" />
</form>
</body>
</html>