changing the default tag for a custom gridview?

Hi There,

I have a custom gridview for which I'm trying to render compliant html. Which method do I need to override in order for the control to render the tag I tell it to? Currently the control is rendering as a <span> I need to change this to a div, so how can I do it?

Sean - thanks in advance for your answer.
Who is Participating?
hehdaddyConnect With a Mentor Commented:
You need to override these:

public override void RenderBeginTag(HtmlTextWriter writer)

public override void RenderEndTag(HtmlTextWriter writer)
Asp.Net usually renders <asp:Label> as <span> and <asp:Panel> as <div>. You need to create custom template definition using <asp:Panel> to get rendered as <div>
MrAgileAuthor Commented:
Hi There,

Can you provide an example or link so I can see how this is done?


<span id="lstStuff"><div class="projectContainer" id="Container0">

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.