[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

(Travis)

12/25/2002 10:25:00 PM

Hello,

The web control <asp:hyperlink> has an ability to add a picture to it:

<asp:hyperlink id="lnkProblemsSigningIn" runat="server"
imageurl="image/my_bag/problems_signin.gif" tooltip="problems signing
in?" width="120" height="14"></asp:hyperlink>

Which is converted after running .aspx web form to the corresponding
HTML code:

<a id="lnkProblemsSigningIn" title="problems signing in?"
href="/passwordreminder.aspx?profile=true"
style="height:14px;width:120px;"><img title="problems signing in?"
src="/image/my_bag/problems_signin.gif" border="0" /></a>

However, IE 5.0 cannot interpret such HTML code as a hyperlink - the
area with the image is not clickable at all. The problem does not
appear in IE 6.0. Other browsers like Opera or Mozilla handle it well.
In general problematic HTML code looks like this:

<a href="..."><img src="..."></a> (when the image is embedded into the
hyperlink)

Why this happens? What is the solution, since many people still are
using IE 5.0, should they upgrade to the IE 6.0 or there is any other
way around?
2 Answers

(Travis)

12/25/2002 10:25:00 PM

0

temporary99@poczta.onet.pl (Travis) wrote in message news:<fecc40c0.0212120636.4ce8702e@posting.google.com>...
> Hello,
>
> The web control <asp:hyperlink> has an ability to add a picture to it:
>
> <asp:hyperlink id="lnkProblemsSigningIn" runat="server"
> imageurl="image/my_bag/problems_signin.gif" tooltip="problems signing
> in?" width="120" height="14"></asp:hyperlink>
>
> Which is converted after running .aspx web form to the corresponding
> HTML code:
>
> <a id="lnkProblemsSigningIn" title="problems signing in?"
> href="/passwordreminder.aspx?profile=true"
> style="height:14px;width:120px;"><img title="problems signing in?"
> src="/image/my_bag/problems_signin.gif" border="0" /></a>
>
> However, IE 5.0 cannot interpret such HTML code as a hyperlink - the
> area with the image is not clickable at all. The problem does not
> appear in IE 6.0. Other browsers like Opera or Mozilla handle it well.
> In general problematic HTML code looks like this:
>
> <a href="..."><img src="..."></a> (when the image is embedded into the
> hyperlink)
>
> Why this happens? What is the solution, since many people still are
> using IE 5.0, should they upgrade to the IE 6.0 or there is any other
> way around?

Ok, I have some clue it is probably the XML syntax generated by asp
.net:
<a href="..."><img src="..." /></a>, which closes the <img> tag, and
by that makes IE 5.0 confused.
But what now? Should I override the Hyperlink's Render method?

Regards
<Travis>

(levous)

12/25/2002 10:26:00 PM

0

the offensive code is actually the style tag!
<img src="..." style="width:94px" border="0">

However, this is how the control gets rendered.
BUMMER!

so I have used a literal control, created the text for the image html
and then added the literal to the link controls collection.

System.Web.UI.WebControls.Literal objImageHTML = new
System.Web.UI.WebControls.Literal();
objImageHTML.Text = "<img src=\"" +sTabFile + "\" width=\"" +
iTabWidth + "\" border=\"0\" >" ;
objLink.Controls.Add(objImageHTML);

You'd think they'd have tested that but, oh well. Please lemme know
if you find a better solution

z

temporary99@poczta.onet.pl (Travis) wrote in message news:<fecc40c0.0212121442.6eb4ab86@posting.google.com>...
> temporary99@poczta.onet.pl (Travis) wrote in message news:<fecc40c0.0212120636.4ce8702e@posting.google.com>...
> > Hello,
> >
> > The web control <asp:hyperlink> has an ability to add a picture to it:
> >
> > <asp:hyperlink id="lnkProblemsSigningIn" runat="server"
> > imageurl="image/my_bag/problems_signin.gif" tooltip="problems signing
> > in?" width="120" height="14"></asp:hyperlink>
> >
> > Which is converted after running .aspx web form to the corresponding
> > HTML code:
> >
> > <a id="lnkProblemsSigningIn" title="problems signing in?"
> > href="/passwordreminder.aspx?profile=true"
> > style="height:14px;width:120px;"><img title="problems signing in?"
> > src="/image/my_bag/problems_signin.gif" border="0" /></a>
> >
> > However, IE 5.0 cannot interpret such HTML code as a hyperlink - the
> > area with the image is not clickable at all. The problem does not
> > appear in IE 6.0. Other browsers like Opera or Mozilla handle it well.
> > In general problematic HTML code looks like this:
> >
> > <a href="..."><img src="..."></a> (when the image is embedded into the
> > hyperlink)
> >
> > Why this happens? What is the solution, since many people still are
> > using IE 5.0, should they upgrade to the IE 6.0 or there is any other
> > way around?
>
> Ok, I have some clue it is probably the XML syntax generated by asp
> .net:
> <a href="..."><img src="..." /></a>, which closes the <img> tag, and
> by that makes IE 5.0 confused.
> But what now? Should I override the Hyperlink's Render method?
>
> Regards
> <Travis>