--用户控件需要传递变量
<uc1:UserControl_2 id="UserControl_21" type=<%=Type%> runat=server></uc1:UserControl_2>
--CS代码:protected string Type="";
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
Type=Request.QueryString["Type"];
}此类问题如何解决?? 谢谢......
<uc1:UserControl_2 id="UserControl_21" type=<%=Type%> runat=server></uc1:UserControl_2>
--CS代码:protected string Type="";
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
Type=Request.QueryString["Type"];
}此类问题如何解决?? 谢谢......
Attributes.Add("Type",Request.QueryString["Type"]);
直接UserControl_21.属性 =
Protected UserControl_2 id UserControl_21;
<uc1:UserControl_2 id="UserControl_21" type=<%=Type%> runat=server></uc1:UserControl_2>
改成:<uc1:UserControl_2 id="UserControl_21" type="<%=Type%>" runat=server></uc1:UserControl_2>