help me to add radiobutton and table only from code behind

Discussion in 'C#' started by hungryfriend, Jul 1, 2009.

  1. #1
    i got a blank aspx page, and i wanna add it with table and radiobutton. but i want to do it only by writing code behind and generate it. i tried using several ways like

    Radiobutton test = new Radiobutton();
    test.Text = "adasd" >> [Not Shown]

    Radiobutton test2 = new Radiobutton();
    this.Control.add(test2) >>[Error]

    i even try to put asp tag inside dbase, but when i used .InnerHtml, the form can't convert the asp tag.

    how could i add a new radiobutton and table only from cs (code behind)? and i don't care if it involved loading data from dbase. help me plz... ^ ^
     
    hungryfriend, Jul 1, 2009 IP
  2. dopanel.com

    dopanel.com Peon

    Messages:
    93
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
      <div id="HelloControl" runat="server"></div>
    
    Code (markup):
    
      Radiobutton Test1 = new Radiobutton();
      Test1.Text = "tset";
      HelloControl.Controls.Add(Test1 );
    
    Code (markup):
     
    dopanel.com, Jul 1, 2009 IP