自定义控件嵌套

    public class DisplayPost : System.Web.UI.WebControls.WebControl,INamingContainer
    
{        

        
protected UC_Button SendMS = new UC_Button();


        
private void SendMS_ButtonClick(object sender, EventArgs e)
        
{
        

            UC_Button ServerPromptTmp 
= (UC_Button)sender;

            
string ActionFlag = ServerPromptTmp.Value;

        }




        
protected override void CreateChildControls()
        
{    
            
            SendMS.ButtonClick 
+=new EventHandler(SendMS_ButtonClick);
            
            
            Controls.Add(SendMS);            

            
base.CreateChildControls();
            
        }





        
protected override void Render(HtmlTextWriter output)
        
{
        
            
this.SendMS.RenderControl(output);

        }






        
private void DisplayPost_PreRender(object sender,EventArgs e)
        
{
            
this.SendMS.ButtonType = "LinkButton";
            
this.SendMS.ButtonCss = "black";
        }



        
override protected void OnInit(EventArgs e)
        
{    
            
this.PreRender += new EventHandler(DisplayPost_PreRender);

            
base.OnInit(e);
        }


    }
posted @ 2005-11-24 15:00 烈马狂生 阅读(132) 评论(0)  编辑 收藏 网摘 所属分类: asp.net



发表评论

昵称: [登录] [注册]

主页:

邮箱:(仅博主可见)

评论内容:

  登录  注册

[使用Ctrl+Enter键快速提交评论]

0 283629




相关文章:

相关链接: