Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Cannot Disable Enabled Property of HyperLink Web Server Control If HyperLink Control Is Inside HTML Table


View products that this article applies to.

This article was previously published under Q320606

↑ Back to the top


Symptoms

When you use the ASP.NET HyperLink Web server control inside an HTML table on a Web Form, you cannot disable navigation even if you set the Enabled property to False.

↑ Back to the top


Resolution

To work around this problem, use one of the following methods:
  • Do not set the NavigateUrl property of the HyperLink control to any value. This provides the functionality as if the HyperLink control is disabled.
  • If you are using Microsoft Visual Studio .NET, use the GridLayout feature that is available in the Designer instead of using an HTML table to position your controls on a page. If you add a HyperLink control outside the HTML table, the Enabled property behaves as expected.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in ASP.NET (included with the .NET Framework) 1.1.

↑ Back to the top


More information

Steps to Reproduce the Behavior

  1. Add an HTML table to an ASP.NET Web Form that is contained in an ASP.NET Web application.
  2. Add a HyperLink Web server control to a cell in the table.
  3. Set the NavigateUrl property of the HyperLink control to http://www.microsoft.com.
  4. Set the Enabled property to False.
  5. Build the Web application.
  6. Open the Web Form in your browser, and then click the link. Notice that the Web page opens to http://www.microsoft.com.

↑ Back to the top


References

For more information, visit the following Microsoft Web sites: For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
306459� INFO: ASP.NET Server Controls Overview

↑ Back to the top


Keywords: KB320606, kbwebforms, kbservercontrols, kbpending, kbbug, kbfix

↑ Back to the top

Article Info
Article ID : 320606
Revision : 3
Created on : 3/26/2003
Published on : 3/26/2003
Exists online : False
Views : 408