Examples upload the composite control sub-control event to the top layer

xiaoxiao2021-03-06  47

This is an example of a selection province and then uploading the event to the top layer of the control at the page processing event. The coarse portion is the entire upload event process. Upload events (exposed events), exposure properties, complex attribute management, style management, etc. are advanced topics for ASP.NET Server custom controls. using System; using System.Web; using System.Web.UI; using System.Data; using System.Data.SqlClient; using System.Web.UI.WebControls; using System.ComponentModel; using Yeno.EnBiz.News.Tools;

Namespace yeno.enbiz.news.controls {///

/// Research summary description of the study. /// [ToolboxData ( "<{0}: LocalCtrl_Province runat = server> ")] public class LocalCtrl_Province: System.Web.UI.WebControls.WebControl, INamingContainer {private TableCell _Province; Public Event CommandeventHandler ClickProvince;

///

/// presented this control to the specified output parameter. /// /// HTML writer to write

protected override void Render (HtmlTextWriter writer) {AddAttributesToRender (writer); writer.AddAttribute (HtmlTextWriterAttribute.Cellpadding, "5", false); writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, "0", false); writer.AddAttribute (HtmlTextWriterAttribute. Width, "100%", false; Writer.Renderbegintag (HTMLTextWritertag.Table);

Writer.renderbegintag (HTMLTextWritrtag.tr); _Province.RenderControl (Writer); Writer.Renderendtag ();

Writer.renderendtag ();} protected override void createchildControls () {if (! page.ispostback) {Controls.clear (); ClearChildViewState ();

_Province = new TableCell ();

CreateProvince ();

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

New Post(0)