Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamic Buttons / Dynamic Button Container on Server Side

I have a Asp.net project having a combobox that have many car groups. However, I want to change it with divided buttons with image on them. But also I have to this buttons make dynamic so that user can add new car groups.

Is it possibble if I don't want to use Ajax requests ? If I can How can I do that ?

Also I have a devexpress. If it is possible with devexpress it also would be ok for me

Thanks in advance for all :) I'm really rookie about web coding. Sorry If I am wrong about some parts.

My combobox code if that helps (I also use objectdatasource for combobox):

<dx:ASPxComboBox ID="txtUrunGrubu" AutoPostBack="true" runat="server" style="margin-top: 0px" Font-Size="Medium" Width="250px" OnSelectedIndexChanged="txtUrunGrubu_SelectedIndexChanged">
       <ItemStyle Font-Size="Medium" />
    </dx:ASPxComboBox>
like image 528
rpd Avatar asked Jul 10 '26 10:07

rpd


1 Answers

you can do something like this

foreach(string fileName in fileEntries)
{
ibImageList = new ImageButton();
ibImageList.ImageUrl = GetDirectoryName(fileName);
ibImageList.Width = new Unit(125, UnitType.Pixel);
ibImageList.CommandName = GetDirectoryName(fileName);
//Add it to the panel
pnlImages.Controls.Add(ibImageList);
pnlImages.Controls.Add(new LiteralControl("<br>"));
}
like image 167
Ankit Avatar answered Jul 12 '26 02:07

Ankit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!