用户控件问题,急
.aspx文件
<%@ Register TagPrefix="xxxx" TagName="xxxx" Src="xxxx.ascx"%>
......
<xxxx:xxxx id="xxxx_1" runat="server"></xxxx:xxxx >
这个用户控件有1个传入参数abc如果就在aspx文件里写的话就可以写为
<xxxx:xxxx id="xxxx_1" abc="1" runat="server"></xxxx:xxxx >
但我现在需在aspx.cs文件里给这个用户控件指定参数。。。。
请问怎么做啊!
http://chs.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx
http://chs.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/ctrlauth/simple/SimpleProperty.src&file=CS\SimpleProperty.cs&font=3
public string Officename
{
get
{
return office;
}
set
{
office=value;
}
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if(this.Officename!=String.Empty)
{
if(this.office=="秘尿系结石诊疗中心")
{
str1="0";
this.IMG1.Visible=false;
str1a="";
str1b="0";
}
if(this.office=="肝胆结石诊疗中心")
{
str2="0";
this.IMG2.Visible=false;
str2a="";
str2b="0";
}
}
base.Render(writer);
}