NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

HtmlAnchor Class

The HtmlAnchor class defines the methods, properties, and events for the HtmlAnchor control. This class allows programmatic access to the HTML <a> element on the server.

Object
   Control
      HtmlControl
         HtmlContainerControl
            HtmlAnchor

[Visual Basic]
Public Class HtmlAnchor
   Inherits HtmlContainerControl
   Implements IPostBackEventHandler
[C#]
public class HtmlAnchor : HtmlContainerControl,
   IPostBackEventHandler
[C++]
public __gc class HtmlAnchor : public HtmlContainerControl,
   IPostBackEventHandler
[JScript]
public class HtmlAnchor extends HtmlContainerControl,
   IPostBackEventHandler

Remarks

There are two ways to use the HtmlAnchor class. The first is for navigation: using the HRef property to define the location of the page to link to. The second is for post-back events: using the OnServerClick event to programmatically handle a user clicking a link text as an event raised on the server.

Requirements

Namespace: System.Web.UI.HtmlControls

Assembly: System.Web.dll

Example [Visual Basic]

[Visual Basic]

<html>
   <script runat=server>
 
      Sub AnchorBtn_Click(Source As Object, E as EventArgs)
         Message.InnerHtml = "Gotcha!"
      End Sub
 
   </script>
 
   <body>
     <form method=post runat=server>
 
        <a OnServerClick="AnchorBtn_Click" runat=server> Click here at your peril.</a>
  
       <h1>
        <span id="Message" runat=server></span>
       </h1>
 
      </form>
    </body>
</html>

See Also

HtmlAnchor Members | System.Web.UI.HtmlControls Namespace | TBD