Q: Loading content around TextBoxes in ASP.NET I'm trying to create a form in ASP.NET but I'd like to know if I can dynamically add HTML content around a TextBox.
Here is the code:
<%@ Page Title="" Language="C#" MasterPageFile="~/MPpacientes.master" AutoEventWireup="true" CodeFile="CuestionarioGeneral.aspx.cs" Inherits="CuestionarioGeneral" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="navbar" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="headertitle" Runat="Server">
Cuestionario General
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="contentbox" Runat="Server">
<legend>Lorem ipsum dolor sia met etcetcetc</legend>
<%-- question1 --%>
<asp:Label ID="lbl1" runat="server" Text="1"></asp:Label>
<div class="input-control text" data-role="input-control">
    <asp:TextBox ID="txt1" runat="server"></asp:TextBox>
    <button class="btn-clear" tabindex="-1"></button>
</div>
<%-- question2 --%>
<asp:Label ID="lbl2" runat="server" Text="2"></asp:Label>
<div class="input-control text" data-role="input-control">
    <asp:TextBox ID="txt2" runat="server"></asp:TextBox>
    <button class="btn-clear" tabindex="-1"></button>
</div>
<%-- question3 --%>
   <%-- etc --%>


As you can see in the code, the content of the < div > and the < button > tags don't change at all in each question, so I wanna know if there's some way to load them from a script so that when the page loads they wrap around each TextBox automatically.
Thanks in advance.

A: If you just need to add a question, you can a <asp:label /> tag, or even a Html label tag and make it runat="server".
And then you can add the text to the label dynamically in the code behind

A: did the total question for each page different or the same?
if different, you can try to use asp:Repeater for that. You can dynamically change the question, and keep the button and div static for every question.
for example :
<asp:Repeater ID="rptQuestion" runat="server" OnItemDataBound="rptQuestion_ItemDataBound">
    <ItemTemplate>
        <asp:Label ID="lblQuestion"></asp:Label>
        <div class="input-control text" data-role="input-control">
            <asp:TextBox ID="txtAnswer" runat="server"></asp:TextBox>
            <asp:Button CssClass="btn-clear" TabIndex="-1" ID="btnClear" runat="server"></button>
        </div>
    </ItemTemplate>
</asp:Repeater>

Edit :
to edit the Label text, you can first add all your question to List<String> then Bind it to the repeater, here's the example :
on PageLoad :
protected void Page_Load(object sender, EventArgs e)
    {
        List<String> listQuestion = new List<String>();

        foreach(string question in ...)
        {
            listQuestion.Add(question);
        }

        rptQuestion.DataSource = listQuestion;
        rptQuestion.DataBind();
    }

then on the ItemDataBound event :
protected void rptQuestion_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                String question = (String)e.Item.DataItem;
                Label lblQuestion = (Label)e.Item.FindControl("lblQuestion");
                lblQuestion.Text = question;
            }
        }

you don't need to change the ID for the Label and TextBox, because it will always be different for each item in the repeater
