Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 14th, 2004, 06:03 AM
Registered User
Join Date: Jul 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default image tag

I am trying to set the image tags attributes in my code as follows
literal_control.InnerHtml = "<img name=""Hello"" alt=""Hello"" scr = ""\images\Hello.gif"""
for some reason that does appear on my webpage what have I done wrong!!
Thanks Bob

Old July 14th, 2004, 04:54 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


You need to access the image directly. If you do it that way, I have a feeling that it may encode the HTML, instead of representing the image.

In addition, this is incorrect, scr = ""\images\Hello.gif""" should be src = ""/images/Hello.gif"""

Hope this helps,

Old July 15th, 2004, 12:15 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik

I dont think useing \ or / make sense!
Just be sure image is in Address u give. Is it there?!

Hovik Melkomian.
Old July 15th, 2004, 12:10 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts

IE will correct the \ to a /, nowever, older versions of netscape won't. I don't know if the new version will.

Old July 18th, 2004, 03:27 PM
planoie's Avatar
Friend of Wrox
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts

Something that would clear up a lot of the problems might be to just use the Image server control. Then you can just set the various properties of the image and .NET will handle the HTML.

Work smarter, not harder

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML tag from C# or ASP.NET tag from javascript angshujit ASP.NET 2.0 Basics 3 February 16th, 2007 10:07 AM
Background Image problem in DIV tag. cumminsj CSS Cascading Style Sheets 6 September 15th, 2006 03:02 AM
Image as an alt tag Adam H-W HTML Code Clinic 3 July 27th, 2006 03:23 PM
HTML tag vs Body Tag CFGerry BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 October 7th, 2005 07:13 AM
Problem with input type image With Anchor tag vinkumrect Javascript How-To 1 July 21st, 2005 08:59 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.