Custom attribute settings and use in the properties of web user emptyware

xiaoxiao2021-03-05  27

public class Bull: System.Web.UI.UserControl {private string _strID; // custom property value MID public string IMID {get {return _strID;} set {_strID = value;}} private string _strPageSize; // custom property the number of display public string IPageSize {get {return _strPageSize;} set {_strPageSize = value;}} public string _strLineTitle; // the line head public string ILineTitle {get {return _strLineTitle;} set {_strLineTitle = value;}} public string IForeColor { set {DLTNews.AlternatingItemStyle.ForeColor = Color.FromName (value);}} public string IBackColor {set {DLTNews.AlternatingItemStyle.BackColor = Color.FromName (value);}} protected System.Web.UI.WebControls.DataList DLTNews; private void Page_Load (object sender, System.EventArgs e) {if (Page.IsPostBack!) {new Sql.TSqlDB () BindDataList ( "Psp_ShowBulletinInfoList" IPageSize "," IMID, DLTNews);.}} ...} Front desk <% = _ strlinetitle%> <% # databinder.eval (container.DataItem, "vc_title")%> Call: This example mainly demonstrates the attribute definition, negative value, and use of the web custom component.

转载请注明原文地址:https://www.9cbs.com/read-34382.html

New Post(0)