M
Marius Horak
If in Design mode I place a button HTML code will look like this:
<form id="Test" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 83px; POSITION:
absolute; TOP: 173px" runat="server"
Text="Button" Width="129px" Height="31px"></asp:Button>
</form>
How can I replicate this using C# - placing a button at selected location on
a page?
In Page_Load I tried:
Button X = new Button();
X.ID ="X";
X.Text="Button X";
X.Width=129;
X.Height=31;
this.Controls.Add(X);
But did not get anything.
So I tried to put the above code inside CreateChildControls - nothing
happened.
Thanks
MH
<form id="Test" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 83px; POSITION:
absolute; TOP: 173px" runat="server"
Text="Button" Width="129px" Height="31px"></asp:Button>
</form>
How can I replicate this using C# - placing a button at selected location on
a page?
In Page_Load I tried:
Button X = new Button();
X.ID ="X";
X.Text="Button X";
X.Width=129;
X.Height=31;
this.Controls.Add(X);
But did not get anything.
So I tried to put the above code inside CreateChildControls - nothing
happened.
Thanks
MH