c# - Generate dynamic 'Span' controller -


i trying create dynamic span controller ,because need insert drop down list created code on it.

here in page load creating list of ddl can see here :

 (int = 0; < numberofquestion; i++)             {                 dropdownlist anslist = new dropdownlist();                 anslist.datasource = clsvoanswer.answer;                 anslist.databind();                 anslist.autopostback = true;                 ddll.add(anslist);             } 

in page create span tag runs in server can see here :

for (int = 0; < numberofquestion; i++)     {         response .write("<div class='rows-score' style='background:transparent'>"+                            "<div class='columns-score'> " +                                 "<span>" +                                         listquestion[i].question +                                 "</span>" +                             "</div>" +                             "<div class='columns-score' style='float:left'>" +                                 "<span style='color:#ea0000;padding:0 10px;' id='span"+i.tostring()+"' runat='server'></span>" +                             "</div>" +                         "</div>");         span[i].controls.add(ddll[i]);     } 

so need put ddl on span tag.but code can't access span tag ,it clear why can't access .

in previous project add span tag manually , can use code :

span1.controls.add(ddll[0]); 

but here generate span tag using for .i want access span in code created dynamically for.

any idea .

best regards


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -