Tuesday, July 16, 2019

How to set href of html anchor tag using c# code



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"");

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...