Work around for missing asp:img title attribute?

K

keith

In an MSDN article on high quality design principles combined with
standards driven code, Microsoft states: that the image title attribute
should display when users roll over the image and that Non-visual browsers
will read this text to people who are blind. In my attempts to implement
this I have found that the ASP.Img control does not have an attribute for
title. It is necessary to use the ASP:IMG control instead of the html img
tag in user controls where the path to the image needs to reference the root
of the application. Is there a work-around for this?

Thanks,

Keith
 
M

Mark Fitzpatrick

In code you can use the Attibutes.Add() method to add any custom attribute
to the asp:image control that you need, including title like so:

myImage.Attributes.Add("title","this is a test");
 
J

Joe Chung

The alt and title attributes work just fine on server-side IMG tags.

<img runat="server" alt="foo" title="bar" />

works like

<asp:Image AlternateText="foo" ToolTip="bar" />
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,083
Members
48,773
Latest member
Kaybee

Latest Threads

Top