[导入]自定义控件嵌套

    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);
        }


    }


树花心岁 2005-11-24 15:00

文章来源:http://Elong.cnblogs.com/archive/2005/11/24/283629.html

posted on 2005-11-24 15:00 毒菇求Buy 阅读(174) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
<2005年11月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

导航

统计

常用链接

留言簿(7)

随笔分类(133)

随笔档案(111)

文章分类(65)

文章档案(53)

相册

收藏夹(30)

BLOG

Book store

Graphics Design

搜索

最新评论

阅读排行榜

评论排行榜