asp.net - Programmatically created controls overwriting each other -


i'm creating labels in code behind of c# .net website. labels hold standard data server.

the problem have add button these created controls (inside label), additional control overwrite text defined in label.

what options stop this?

for (var = 0; < (quotearray.length)-1; i++)         {             button[] btnarr = new button[quotearray.length]; //not used              var button = new button             {                 id = "quote_0" + i,                 commandargument = "i",                 text = "!!",                 cssclass = "countbutton"             };              label addl1 = new label             {                 id = "new_labeieeu" + i,                 text = string.format("tariff: {1}</br>reference: {0}</br>price: £{3}</br>excl. vat.</br>max passenger: {4}</br>max luggage: {5}</br>{2}</br>", quotearray[i][0], quotearray[i][1], quotearray[i][2], quotearray[i][3], quotearray[i][4], quotearray[i][5], quotearray[i][6]),                 cssclass ="quotebutton"              };             panelquote.controls.add(addl1);             addl1.controls.add(button);         } 

you adding button label, can way

panelquote.controls.add(addl1); panelquote.controls.add(button); 

this add button next label.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -