table id generated from datagrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,
I have extended WebControl which contains a datagrid in it. I am using that WebControl dynamically in my code to show datagrid. When the datagrid is rendered in the browser the id of the table being rendered is a autogenerated one like '_ctl2', ** but I want to assign my own name to the html table id by exposing a property in my WebControl **.
I have tried to set the grid.Attributes["id"] = <customname>, but that is generating multiple ids, with one id with the id value I gave and another id with the autogenerated one.
Can anybody please reply how can I get to assign user choice name to the generated table id.

Thanks,
Shravan.

P.S : Please remove (NO) and (SPAM) to send a mail to me
 
i'm not sure whether i correctly understood the problem, but try assigning
child control's ID property to name you want (e.g. dg.ID = "innerTable")
 
Hi Rotuski,
But when I am assigning it using dg.Id = "innerTable", its generating html
with <table name="innerTable" id="_ctl2">
but I need <table name="innerTable" id="innerTable">

Id is more important to me here.

Thanks,
Shravan.
 
Back
Top