Solved

changing the default tag for a custom gridview?

Posted on 2009-04-07
3
329 Views
Last Modified: 2013-11-08
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
Comment
Question by:MrAgile
3 Comments
 
LVL 14

Expert Comment

by:GiftsonDJohn
Comment Utility
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
 
LVL 8

Author Comment

by:MrAgile
Comment Utility
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
 
LVL 6

Accepted Solution

by:
hehdaddy earned 500 total points
Comment Utility
You need to override these:

public override void RenderBeginTag(HtmlTextWriter writer)
{
}

public override void RenderEndTag(HtmlTextWriter writer)
{
}
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now