I am creating a .Net web application. It is a form and the contents like the text, drop downs, check boxes change often so i don't want to create the markup in ascx file. I want to create them dynamically like from an xml or something like that.
Can any one please advise of what is the best method to achieve my scenario ? Can i use XAML in web application ? Thanks.
if you add a runat="server" tag to your form, then you can manipulate its controls programmatically at the server-side.
<form id="form1" runat="server"></form>
Then in your server-side code just do something like this
var lbl = new Label();
lbl.Text = "this is my label";
form1.Controls.Add(lbl);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With