用户控件赋值问题,不报错也没反应!怎么回事啊????
仙人掌 2003-08-02 12:35:42 UserControlDemo.ascx.cs
public class WebUserControl1 : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.Label Label1;
public string strInfo;
public string sText
{
set
{
strInfo=value;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
if(strInfo==null)
{
strInfo="Not Click";
}
if (!this.IsPostBack)
{
Label1.Text=strInfo;
}
}
#region Web 窗体设计器生成的代码
}
WebForm1.aspx.cs
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
protected UserControlDemo.WebUserControl1 WebUserControl11;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
}
#region Web 窗体设计器生成的代码
private void Button1_Click(object sender, System.EventArgs e)
{
WebUserControl11.sText="Topindotnet@";
}
}
我在WebForm1中点Button1 没有反应 还是显示"Not Click"
请问是怎么回事啊??