i am trying to create a hyperlink from code-behind, but it is not creating it where i want it to be.
if i look at my souce code is creating somewhere else and from .aspx page it seems like everything is in place where it needs to be.
.aspx
<div class="AZ">
<ol class="AZlist">
<asp:PlaceHolder runat="server" ID="AToZ"></asp:PlaceHolder>
</ol>
</div>
.codebehind
HyperLink links = new HyperLink();
links.Text = "<li>" + CheckMe.ToString() + "</li>";
links.NavigateUrl = "<a href='#'" + CheckMe.ToString() + ">";
ph.Controls.Add(links);
source code:
….
….
…
<div class="AZ">
<ol class="AZlist">
// I WANT HYPERLINK HERE....!!!!!!!!!!!
</ol>
<br />
</div>
</li>
but its creating outside the div area here
<a href="#A"><li>A</li></a>
I dont think you should put those tags in the .text and .navigateurl properties. just put the link and the text in them. Put the
<li>tags around the placeholder.