How to Remove SPAN tag from the Web Custom controls

  • Thread starter Thread starter Flavio
  • Start date Start date
F

Flavio

i'm creating a WebUserControl that overrides the RenderContents method,
on that i generate the HTML to the writer.
here the problem is that on the html code of the page i've one more tag
that i doesn't whant <span>!
What can i do to remove this tag from the renderes results?

Overrided Method:
Protected Overrides Sub RenderContents(ByVal output As HtmlTextWriter)
MainRender() ' Generates the Content
output.Write(m_strOutputa)
End Sub

The MainRender method on Overrided Sub RenderContents generates the
folowing HTML code:
<table id="MenuOP1" class="s" width="100px">
<tr>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
</table>


Unfortunaly i get one exta span tag in the html source of page:
....
<span id="MenuOP1" style="display:inline-block;width:100px;"><table
id="MenuOP1" class="s" width="100px">
<tr>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
</table>
</span>
....

How to remove the span tag
 
Hi,
I am not sure about it but, do you get some event like the
PreRender ? If yes then you can remove the tags there. (not sure if it
will help you but atleast you can give it a shot)


Thanks !
 
Sure, try a newsgroup that discusses HTML.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
To remove Span Tag from your WebUserControl, use this :

public override void RenderBeginTag(HtmlTextWriter writer)
{
writer.Write("");
}
public override void RenderEndTag(HtmlTextWriter writer)
{
writer.Write("");
}

I Hope that can help you.
Polykos
 
Back
Top