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. Calling <img src="#" /> tag ?

Calling <img src="#" /> tag ?

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelpquestion
4 Posts 2 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.
  • H Offline
    H Offline
    hifiger2004
    wrote on last edited by
    #1

    Hi Guys, I am using VS2008 ASP.Net 3.5. I have a masterpage.main where <img id="image1" src="image1.jpg" /> is located. My problem now is, in my sub page how am I be able to change the src="image1.jpg" to image2.jpg at runtime? For finding and changing the value of standard image control, I am using this code - CType(Page.Master.FindControl("image1"), Image).ImageUrl = "~/images/image1.jpg" But how will I do the same when changing the <img src=#/>   value? Any ideas? Thanks in advance.

    hifiger2004

    N 1 Reply Last reply
    0
    • H hifiger2004

      Hi Guys, I am using VS2008 ASP.Net 3.5. I have a masterpage.main where <img id="image1" src="image1.jpg" /> is located. My problem now is, in my sub page how am I be able to change the src="image1.jpg" to image2.jpg at runtime? For finding and changing the value of standard image control, I am using this code - CType(Page.Master.FindControl("image1"), Image).ImageUrl = "~/images/image1.jpg" But how will I do the same when changing the <img src=#/>   value? Any ideas? Thanks in advance.

      hifiger2004

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      hifiger2004 wrote:

      For finding and changing the value of standard image control...But how will I do the same when changing the

      Why can't you use a Image control instead of the img tag? http://msdn.microsoft.com/en-us/library/system.web.ui.control.resolveurl.aspx[^]


      only two letters away from being an asset

      H 1 Reply Last reply
      0
      • N Not Active

        hifiger2004 wrote:

        For finding and changing the value of standard image control...But how will I do the same when changing the

        Why can't you use a Image control instead of the img tag? http://msdn.microsoft.com/en-us/library/system.web.ui.control.resolveurl.aspx[^]


        only two letters away from being an asset

        H Offline
        H Offline
        hifiger2004
        wrote on last edited by
        #3

        Hi Mark, There's an existing codes already being developed by previous developer using an img tag for all images in the master page. If it's only 1 img tag, I wouldn't hesitate to change it to standard Image control. This is the situation now, so instead of changing all the img tag to a standard Image control I prefer to call the img and change the src value if there's a simple way of making it work.. But I am not sure if how possible, workable, I don't know. What can you suggest, better just change them all from img tag into the standard Image control, there's no other solution? Thanks

        hifiger2004

        N 1 Reply Last reply
        0
        • H hifiger2004

          Hi Mark, There's an existing codes already being developed by previous developer using an img tag for all images in the master page. If it's only 1 img tag, I wouldn't hesitate to change it to standard Image control. This is the situation now, so instead of changing all the img tag to a standard Image control I prefer to call the img and change the src value if there's a simple way of making it work.. But I am not sure if how possible, workable, I don't know. What can you suggest, better just change them all from img tag into the standard Image control, there's no other solution? Thanks

          hifiger2004

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          Did you even look at the link I included? You're answer is there.

          hifiger2004 wrote:

          so instead of changing all the img tag to a standard Image control I prefer to call the img

          So instead of taking the time to do it right, you'll waste time on work-arounds that may not be useful in the future, in which case you'll again waste time on a work-around. But then I notice the code is VB and this is typical VB mentality. X|


          only two letters away from being an asset

          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