用户控件里面做个属性
private int _test;
public int test
{
get { return _test; }
set { _test = value; }
}
页面上slide1.test这样就可以。
public string text
{
set { test.InnerText = value; }
get { return test.InnerText; }
}
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<div>
<li runat="server" id="test"></li>
</div>
protected void Button1_Click(object sender, EventArgs e)
{
this.WebUserControl1.text = "li 测试值";
}