Because I haven't come for some time, I have recently asked this as much as it is still very much. So I deliberately wrote an example. (I have written many times before, but the post is archived)
There is no more writing, there is a problem with questions.
I hope to help you develop comparison.
<% @ Page language = C #%>
Public class mycontrol: control, inamingcontainer {Button Btn1; HyperLink Link1; LinkButton BTN2; HyperLink Link2;
override protected void CreateChildControls () {CreateControlsByType ();} protected void CreateControlsByType () {object o = ViewState [ "type"]; int t = o == null 1:? (int) o; // defaults to 1 if the program (t == 1) {btn1 = new button (); btn1.text = "Switch to scheme 2"; btn1.click = new eventhandler (btn1_click); link1 = new hyperlink (); link1.navigateURL = "http: / /www.asp.net "; link1.text =" link1 "; controls.add (New LitralControl ("
")); controls.add (btn1); controls.add (New LiteralControl (" td> | ")); controls.add (link1); controls.add (New LitralControl (" td> TR> Table>));} ELSE / / Program 2 {btn2 = new linkButton (); btn2.text = "Switch to scheme 1"; btn2.click = new eventHandler (btn2_click); link2 = new hyperlink (); link2 = new hyperlink (); link2.navigateURL = "http://www.microsoft.com"; link2.text = "link2"; controls.add (New LitralControl ("
|