In this article i have explain how to set href of html anchor tag using c# code. for doing this i have add anchor tag in web page and give it to the specific id.
<a id="GotoNewPage" runat="server">Go to New Page</a>
Now set the href by c# code.
GotoNewPage.Attributes.Add("href", "newPage.aspx"");