locked
can i create server control without span? RRS feed

  • Question

  • User2033643981 posted

    hello

    when i create a server control by default

    my controls place in a span this span give server control id

    can i create a server control that when campile to html not have a span

     

    thanks

    IFA 

    Saturday, March 6, 2010 8:18 AM

Answers

  • User-964569287 posted

    here you are

    <asp:literal id="litTest" runat="server" Text="Put your text here"/>


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 8, 2010 2:18 AM

All replies

  • User-964569287 posted

    All server control except literal will create span as far as i know. So if you dont want to use span, use literal control instead ;-)


    Sunday, March 7, 2010 6:33 AM
  • User2033643981 posted

    hi

    thanks for your reply

    can you send a simple exampl to me?

     

    IFA 

    Monday, March 8, 2010 1:26 AM
  • User-964569287 posted

    here you are

    <asp:literal id="litTest" runat="server" Text="Put your text here"/>


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, March 8, 2010 2:18 AM
  • User-1575438868 posted

    You can override the property TagKey and provide the tag you want.

    In following example, the rendered tag used for the control is div:

     

        Protected Overrides ReadOnly Property TagKey() As HtmlTextWriterTag
            Get
                Return HtmlTextWriterTag.Div
            End Get
        End Property


     

    Thursday, March 11, 2010 9:02 AM