I am a newbie in asp.net. I am trying to load the text and the URL into hyperlink from a database. After debugging, I found out that the value is successfully loaded into the hyperlink control, however it doesn't shows at the html code? Does anyone knows how this happened? Sorry for my bad English.
If myReader2.Read Then
Dim temp_panel As Panel
Dim temp_hyperlink As HyperLink
temp_panel = FindControlRecursive(Me, "Panel" & i.ToString())
temp_panel.CssClass = "accordionItem"
temp_hyperlink = FindControlRecursive(Me, "HyperLink" & (i).ToString())
temp_hyperlink.Text = myReader2("Text")
temp_hyperlink.NavigateUrl = myReader2("Link")
temp_hyperlink.CssClass = "accordionItem"
temp_hyperlink.RenderControl(o)
myConn2.Close()
End If
above is the code-behind.
<asp:Panel ID="Panel1" runat="server" class="accordionIteminvisible"><asp:HyperLink ID="HyperLink1" runat="server" /></asp:Panel>
<asp:Panel ID="Panel2" runat="server" class="accordionIteminvisible"><asp:HyperLink ID="HyperLink2" runat="server" /></asp:Panel>
<asp:Panel ID="Panel3" runat="server" class="accordionIteminvisible"><asp:HyperLink ID="HyperLink3" runat="server" /></asp:Panel>
above is the asp code.
<div id="ctl00_AccordionPane1_content_Panel1" class="accordionIteminvisible">
</div>
<div id="ctl00_AccordionPane1_content_Panel2" class="accordionIteminvisible">
<a id="ctl00_AccordionPane1_content_HyperLink2"></a>
</div>
<div id="ctl00_AccordionPane1_content_Panel3" class="accordionIteminvisible">
<a id="ctl00_AccordionPane1_content_HyperLink3"></a>
</div>
above is the html code.