.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> XML >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

create composite custom control

Posted By:Sagar Pardeshi       Posted Date: February 27, 2011    Points: 25    Category: XML    URL: http://www.dotnetspark.com  

composite control are created by combining two or more control.mycompositecontrol created using TextBox and one button.
 

public class  myCompositeControl:system.web.UI.WebControls .Webcontrol
{

Private TexrBox txtx1;
Private Button button1;
public mycompositeControl()
{
text1=new TextBox();
text1.text="Hello";
button1=new Button();
button1.Text="Show";
}
Protected override void CreateChildControls()
{
this.Controls.Add(text1);
this.Controls.Add(button1);
base.CreateChildControls();

}
Protected override void RenderContents(HTMLTextWriter writer)
{
base.RenderContents(writer);
}
}


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend