Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. After All My Years

After All My Years

Scheduled Pinned Locked Moved The Weird and The Wonderful
asp-netcsharpjavascripthtmlcom
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AspDotNetDev
    wrote on last edited by
    #1

    I have only just found out what this would do:

    <!-- <my:control runat="server" /> -->

    That line was causing one of our webpages to load extremely slow, and I wasn't sure why. It seems a control placed inside of an HTML comment in an ASP.NET page will actually be executed (the control was in development and was very slow). So the HTML that gets output based on the above code might be:

    <!-- <p>Hello</p> -->

    Using a server-side comment, on the other hand, does not cause this problem:

    <%-- <my:control runat="server" /> --%>

    That will not render to any HTML (as expected). I suppose it makes sense, but still had me stumped for a bit.

    [Managing Your JavaScript Library in ASP.NET]

    B P 2 Replies Last reply
    0
    • A AspDotNetDev

      I have only just found out what this would do:

      <!-- <my:control runat="server" /> -->

      That line was causing one of our webpages to load extremely slow, and I wasn't sure why. It seems a control placed inside of an HTML comment in an ASP.NET page will actually be executed (the control was in development and was very slow). So the HTML that gets output based on the above code might be:

      <!-- <p>Hello</p> -->

      Using a server-side comment, on the other hand, does not cause this problem:

      <%-- <my:control runat="server" /> --%>

      That will not render to any HTML (as expected). I suppose it makes sense, but still had me stumped for a bit.

      [Managing Your JavaScript Library in ASP.NET]

      B Offline
      B Offline
      BobJanova
      wrote on last edited by
      #2

      I'm not sure that's Hall of Shame worthy, seems like quite an understandable mistake to me! (Particularly as the 'commented out' code probably shows in green in your IDE ...)

      W 1 Reply Last reply
      0
      • B BobJanova

        I'm not sure that's Hall of Shame worthy, seems like quite an understandable mistake to me! (Particularly as the 'commented out' code probably shows in green in your IDE ...)

        W Offline
        W Offline
        walterhevedeich
        wrote on last edited by
        #3

        BobJanova wrote:

        I'm not sure that's Hall of Shame worthy, seems like quite an understandable mistake to me! (Particularly as the 'commented out' code probably shows in green in your IDE ...)

        I agree. In addition, this can be a good post to the Tip/Trick section.

        Good judgment comes from experience, and experience comes from bad judgment. Barry LePatner

        1 Reply Last reply
        0
        • A AspDotNetDev

          I have only just found out what this would do:

          <!-- <my:control runat="server" /> -->

          That line was causing one of our webpages to load extremely slow, and I wasn't sure why. It seems a control placed inside of an HTML comment in an ASP.NET page will actually be executed (the control was in development and was very slow). So the HTML that gets output based on the above code might be:

          <!-- <p>Hello</p> -->

          Using a server-side comment, on the other hand, does not cause this problem:

          <%-- <my:control runat="server" /> --%>

          That will not render to any HTML (as expected). I suppose it makes sense, but still had me stumped for a bit.

          [Managing Your JavaScript Library in ASP.NET]

          P Offline
          P Offline
          Philippe Mori
          wrote on last edited by
          #4

          Another thing to be aware is that style comment will be sent with the web page while server side comments (using <%-- --%>) are stripped.

          Philippe Mori

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups