Click here to Skip to main content
15,885,954 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I basically just want to generate aspx link buttons based on a query result stored as an array or any other applicable variable type.

Here's what the "raw" HTML concept looks like. I will comment what the pattern will be so it will be easier.

HTML
<ul class="dropdown-menu dropdown-menu-right">
    <li>
        <ul class="dropdown-settings">
            <li><a href="#">
                    <em class="fa fa-cog"></em> Settings 1 <!--This is where the first result of the query will be-->
                </a></li>
            <li class="divider"></li>
            <li><a href="#">
                    <em class="fa fa-cog"></em> Settings 2 <!--This is where the second result of the query will be-->
                </a></li>
            <li class="divider"></li>
            <li><a href="#">
                    <em class="fa fa-cog"></em> Settings 3 <!--This is where the last result of the query will be-->
                </a></li>
        </ul>
    </li>
</ul>


What I have tried:

I've already tried asp:Literal but didn't work as it doesn't support dynamic asp content. I don't know how to work with asp:reapeater too..
Posted
Comments
DerekT-P 3-May-21 15:29pm    
If all you're generating is a link, why do you need to use an ASP control? Just generate the tag in your code and write it out (either by populating the ASP:Literal text content) or just use the <%= ... %> shorthand tag.
[no name] 3-May-21 19:21pm    
The reason why I need to dynamically generate the linkbuttons are because I need to create the buttons based on the results of query. The origin of the button or object counts are dynamic. (query based)
DerekT-P 4-May-21 12:36pm    
I get that, but why does it have to be an ASP control? Why not just generate the html tag?
[no name] 7-May-21 0:33am    
uhm because I want the buttons generated to call a function on my code bihin
DerekT-P 7-May-21 4:15am    
Doesn't really explain why it has to be an ASP control... but hey ho, if that's the way you feel you need to go...
You say you don't know how to work with asp:repeater - then it may be worth you looking at the documentation for that and at some examples.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900