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



The information in this article applies to:

  • Microsoft ASP.NET (included with the .NET Framework) 1.0

This article was previously published under Q320606

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.

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.

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.

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.

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


Modification Type:MajorLast Reviewed:3/26/2003
Keywords:kbfix kbbug kbpending kbServerControls kbWebForms KB320606