views:

15

answers:

1

We have following ASP.Net 2.0 HyperLink Control:

asp:HyperLink ID="FolderLink" runat="server" CssClass="cursor" Enabled="false" ImageUrl="/_layouts/1033/images/selectlink.gif" ToolTip="Folder Links">

On server side, following script is attached:

FolderLink.Attributes.Add("onclick", "javascript:setURL('Control');");

Issue is that HyperLink Control is disbale in IE 8 but not in IE compatibility mode. Any help?

A: 

For one, it should be this, don't put javascript: in onclick

FolderLink.Attributes.Add("onclick", "setURL('Control');");

But its not clear to me what this setURL() function has to do with your question.

If you don't want your onclick to be called then why are you adding it in the first place? If you explain the problem better you'll get a better answer.

jarrett
We want our HyperLink control to be disbale when page is loaded. We achieved this by setting Enabled="false" property of HyperLink control during design. Java script function setURL('Control') is binded to HyperLink control when page is loaded. Issue is that this all works fine in IE 8 but not in IE 8 compatibility mode. When page is loaded in IE compatibility mode, HyperLink control is not disable even when Enabled="false" in the design mode.
Malik