有index.aspx
a.ascx
a1.ascx
a2.ascxindex.aspx加载a.ascx
|a.ascx判断,在加载a1.ascx或a2.ascx
|然后,a1.ascx或a2.ascx显示在index.aspx页中该怎么写asp.net c#????????
a.ascx
a1.ascx
a2.ascxindex.aspx加载a.ascx
|a.ascx判断,在加载a1.ascx或a2.ascx
|然后,a1.ascx或a2.ascx显示在index.aspx页中该怎么写asp.net c#????????
tks!!
可以定义个属性比如
private string _dwdm = "";
public string Dwdm
{
get
{
return this._dwdm;
}
set
{
this._dwdm = value;
}
}index.aspx加载a.ascx在后台写属性值,比如a.ascx控件名为dw_head
this.dw_head.Dwdm = "XXX";你把a1.ascx或a2.ascx
代码弄到a.ascx即可,没必要弄a1.ascx和a2.ascx,根据参数控制对象的是否显示.
if (this._dwdm == "XXX")
{
this.divFlash.Visible = false;
this.divPic.Visible = true;
}