asp.net - Change the name of the radiobutton in the gridview while render -


after render group name comes in name attribute different name each radiobutton in gridview.

i tried set names same. when see source in browser unique.

how change name radiobutton in gridview same.

protected override void render(htmltextwriter writer) {     system.io.stringwriter sw = new system.io.stringwriter();     htmltextwriter htw = new htmltextwriter(sw);     base.render(htw);     htw.close();     string h = sw.tostring();      radiobutton first = (radiobutton)gvaddoption.rows[0].cells[3].findcontrol("rblvalue");     string uniqgroupname = first.uniqueid;     uniqgroupname = uniqgroupname.replace(first.id, first.groupname);       foreach (gridviewrow row in gvaddoption.rows)     {         radiobutton val = (radiobutton)row.cells[3].findcontrol("rblvalue");         string eachgroupname = val.uniqueid;         eachgroupname = eachgroupname.replace(val.id, val.groupname);         //h.replace("name=\"" + eachgroupname + "\"", "name=\"" + uniqgroupname + "\"");          h.replace(eachgroupname, uniqgroupname);      }      writer.write(h); } 

thanks.

how using html controls instead of .net ones? should give move control on rendered.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -