Solved

changing the default tag for a custom gridview?

Posted on 2009-04-07
3
340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Expert Comment

by:GiftsonDJohn
ID: 24085726
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
ID: 24085784
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
ID: 24100831
You need to override these:

public override void RenderBeginTag(HtmlTextWriter writer)
{
}

public override void RenderEndTag(HtmlTextWriter writer)
{
}
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Studio npm 1 29
Exception when using Alea null reference in fsharp.core.dll 3 55
asp.net figure out error 3 26
Adjust the codes 3 36
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 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