asp.net - How to change colspan of a td dynamically in c#? -


  <footertemplate>     <tr style="background-color:orange;">     < td width="6%" align="center" id = "tdfooter" runat = "server" colspan = "3">                                        </td> </tr> </footertemplate> 

i have repeater control in have footer template. want change colspan of tdfooter @ itemdatabound event(c#) on basis of if clauses.how can same?

if (e.item.itemtype == listitemtype.footer) {     if(role = 0)        {          //tdfooter colspan should 3        } else       {         //tdfoote colspan should 2       } } 

i add runat td tag

<td runat="server" id="tdcontrol"> 

in itemdatabound:

 var td = (htmltablecell)e.item.findcontrol("tdcontrol");  td.attributes.add("colspan", mynumber); 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -