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