Article ID: 320606
Article Last Modified on 3/26/2003
APPLIES TO
- Microsoft ASP.NET 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
- Add an HTML table to an ASP.NET Web Form that is contained in an ASP.NET Web application.
- Add a HyperLink Web server control to a cell in the table.
- Set the NavigateUrl property of the HyperLink control to http://www.microsoft.com.
- Set the Enabled property to False.
- Build the Web application.
- 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:
Introduction to the HyperLink Web Server Control
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconIntroductionToHyperLinkWebControl.asp
HyperLink Web Server Control
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconHyperlinkWebControl.asp
Adding HyperLink Web Server Controls to a Web Forms Page
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskAddingHyperLinkWebControlToWebFormsPage.asp
Web Server Controls
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconaspsyntaxforwebcontrols.asp
For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
306459 INFO: ASP.NET Server Controls Overview
Additional query words: WebForms Hyperlink
Keywords: kbbug kbfix kbwebforms kbpending kbservercontrols KB320606