62,041
社区成员
发帖
与我相关
我的任务
分享
protected virtual bool LoadPostData(string postDataKey, NameValueCollection postCollection)
{
base.ValidateEvent(postDataKey);
string text = this.Text;
string str2 = postCollection[postDataKey];
if (!this.ReadOnly && !text.Equals(str2, StringComparison.Ordinal))
{
this.Text = str2;
return true;
}
return false;
}
//自定义控件
public class SampleControl : WebControl{
[Bindable(true)]
[Category("Appearance")]
[DefaultValue("")]
[Localizable(true)]
public string Text
{
get;set;
}
#endregion
protected override void Render(HtmlTextWriter writer)
{
writer.Write(Text);
}
}
}
protected void Button2_Click(object sender, EventArgs e)
{
this.SampleControl1.Text = "btn1";
}
protected void Button3_Click(object sender, EventArgs e)
{
}