蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程


    

蓝森林 http://www.lslnet.com 2006年8月25日 8:28

.net用户控件 新手求助

用VWD新建的用户控件,基本上都是自动生成的代码,
后台编码不起作用

有会的指点一二,谢谢

aspx文件内容如下:

<%@ Register TagPrefix="uc1" TagName="PasswordChange" Src="webusercontrol.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
        <HEAD>
                <title>PasswordConfig</title>
                </HEAD>
        <body >
                <form id="Form1" method="post" runat="server">
                        <FONT face="宋体">
                       
                                <uc1:passwordChange id="PasswordChange1" runat="server"></uc1:passwordChange></FONT>
                </form>
        </body>
</HTML>


webusercontrol.ascx内容如下:
<%@ Control Language="C#" AutoEventWireup="false" Codebehind="WebUserControl.ascx.cs" %>
<asp:Label ID="label1" Text="123" runat="server"></asp:Label>

webusercontrol.ascx.cs内容如下:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Include_WebUserControl : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.label1.Text = "321";
    }
}

编译一下

没装VS 编译挺麻烦的 我试着把Inherits去,倒是不报错了,后台cs文件不起作用

继续请教

持续关注,一起学习~

不编译咋能行?

最后还是编译了 用的命令行

又出新问题,要用到已经编译好的dll里的类 其命名空间是webs.include
用using webs.include
再编译报错 ,include在webs中不存在..

怎么让csc认识那个.是名字中的一部分呢?




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com