Hyperlinks inside Accordion/Repeater Pane RRS feed

  • Question

  • User1769015664 posted

    How do I add multiple hyperlinks inside the pane from the database? Currently, it displays "Title" in the header and "Content" inside it.

    <table border="0" >
            <td class="label_topped">
                <div id="dvAccordian" style = "width:400px">
                    <asp:Repeater ID="rptAccordian" runat="server">
                                <%# Eval("Title") %>
                                    <%# Eval("Content") %>
            <td class="auto-style2"></td> 
    private void BindRepeater()
            string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
            using (SqlConnection con = new SqlConnection(constr))
                using (SqlCommand cmd = new SqlCommand())
                    cmd.CommandText = "select Title, Content from AccordianContent";
                    cmd.Connection = con;
                    rptAccordian.DataSource = cmd.ExecuteReader();

    Tuesday, April 18, 2017 9:21 PM


  • User1769015664 posted

    Never mind; I have figured it out.... My main issue was an extra space at the end of the hyperlink.

    <asp:HyperLink runat="server" NavigateUrl='<%# Eval("Content") %>' Text='<%# Eval("Content") %>'/>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 18, 2017 11:00 PM