Smart    Lucky

Smart Lucky

  • NA
  • 555
  • 640.9k

Problem in Createing run time Button

Mar 19 2012 5:51 AM
Hi
i have created button on run time and adding  some attributes and when i want to add post attribute at run time it added successfully but not working can any one tell how can i do this...?




        Button btn = new Button();
        btn.ID = "btn5";
        btn.Attributes.Add("runat", "server");
        btn.Attributes.Add("onclick", "pop('" + btn.ID + "')");
      //  btn.Attributes.Add("PostBackUrl", "~/Default2.aspx");
        btn.Text = "Test";
        this.form1.Controls.Add(btn);

Answers (1)