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. Web Development
  3. ASP.NET
  4. Image not shown in masterpage when content page is in sub-folder.

Image not shown in masterpage when content page is in sub-folder.

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
5 Posts 3 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
    Asif Rehman
    wrote on last edited by
    #1

    in MasterPage

    if content page is in root folder, It works fine. but for sub-folders, pages not showing image. How to make a Master page standard for root and sub-folder? Regards Asif Rehman

    A 1 Reply Last reply
    0
    • A Asif Rehman

      in MasterPage

      if content page is in root folder, It works fine. but for sub-folders, pages not showing image. How to make a Master page standard for root and sub-folder? Regards Asif Rehman

      A Offline
      A Offline
      Anurag Gandhi
      wrote on last edited by
      #2

      Keep the image relative to the root folder and add runat="server" attribute.

      <img runat="server" src="~/Images/logo.jpg" />

      Assuming that the Images folder is present in the Root folder. Hope this will help you.

      Anurag Gandhi.
      http://www.gandhisoft.com
      Life is a computer program and every one is the programmer of his own life.
      My latest article: Group GridView Data

      A 1 Reply Last reply
      0
      • A Anurag Gandhi

        Keep the image relative to the root folder and add runat="server" attribute.

        <img runat="server" src="~/Images/logo.jpg" />

        Assuming that the Images folder is present in the Root folder. Hope this will help you.

        Anurag Gandhi.
        http://www.gandhisoft.com
        Life is a computer program and every one is the programmer of his own life.
        My latest article: Group GridView Data

        A Offline
        A Offline
        Asif Rehman
        wrote on last edited by
        #3

        Thanks for your little but effective help. How to format server control element in css file. normally we can format html controls like div { ... } but how to format asp:label & other controls. should we write it as asp:label { ... } Regards Asif Rehman

        R A 2 Replies Last reply
        0
        • A Asif Rehman

          Thanks for your little but effective help. How to format server control element in css file. normally we can format html controls like div { ... } but how to format asp:label & other controls. should we write it as asp:label { ... } Regards Asif Rehman

          R Offline
          R Offline
          Rhys Gravell
          wrote on last edited by
          #4

          CSS styling should target the appropriate html control that an asp.net control is rendered as. An 'asp:Label' renders as a 'Span' html control.

          Rhys "With no power comes no responsibility"

          1 Reply Last reply
          0
          • A Asif Rehman

            Thanks for your little but effective help. How to format server control element in css file. normally we can format html controls like div { ... } but how to format asp:label & other controls. should we write it as asp:label { ... } Regards Asif Rehman

            A Offline
            A Offline
            Anurag Gandhi
            wrote on last edited by
            #5

            Asif Rehman wrote:

            How to format server control element in css file

            Just as you are formating Html controls in css files, It is convension to format server controls in .skin files. Just google "Asp.Net Themes" and you will understand how you can implement it.

            Anurag Gandhi.
            http://www.gandhisoft.com
            Life is a computer program and every one is the programmer of his own life.
            My latest article: Group GridView Data

            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