vendredi 31 juillet 2015

Programmatically adding a Panel control adds "body" to its ID

So I have this code:

var pnl = new Panel() {
    CssClass = "tab-pane",
    ID = "tab_content_" + gymTypes.Rows[0]["stars"].ToString()
};
tab_content.Controls.Add(pnl);

The gymTypes.Rows[0]["stars"] returns 1 so the ID should be tab_content_1 however when I run the website and inspect element the ID is somehow body_tab_content_1.

Is there a reason for this?

Aucun commentaire:

Enregistrer un commentaire