• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 358
  • Last Modified:

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.
0
MrAgile
Asked:
MrAgile
1 Solution
 
GiftsonDJohnCommented:
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>
0
 
MrAgileAuthor Commented:
Hi There,

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

Sean

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

Open in new window

0
 
hehdaddyCommented:
You need to override these:

public override void RenderBeginTag(HtmlTextWriter writer)
{
}

public override void RenderEndTag(HtmlTextWriter writer)
{
}
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Tackle projects and never again get stuck behind a technical roadblock.
Join Now