MS MVP 请进:如何調用在ASP.NET的C# Script中,用 定義的控件? yxdh 2003-03-22 01:52:20 <%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<script language="C#" runat="server">
protected void Page_Load(Object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection("server=(local)\\NetSDK;database=pubs;Trusted_Connection=yes");
SqlDataAdapter myCommand = new SqlDataAdapter("select * from Authors", myConnection);
myConnection.Open();
DataSet ds = new DataSet("Report");
myCommand.Fill(ds, "作者");
myConnection.Close();
MyDataGrid.DataSource=ds.Tables["作者"].DefaultView;
MyDataGrid.DataBind();
我想在这里用my.dll里的函数该怎么做?
}
</script>
<body>
<h3><font face="宋体">DataGrid 控件的简单选择</font></h3>
<ASP:DataGrid id="MyDataGrid" runat="server"
Width="700"
BackColor="#ccccff"
BorderColor="black"
ShowFooter="false"
CellPadding=3
CellSpacing="0"
Font-Name="宋体"
Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="false"
/>
<OBJECT id="print" classid="http:my.dll#my.init" Width="100%" Height="220" VIEWASTEXT></OBJECT>
</body>
</html>