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
Post a Comment