Click here to Skip to main content
15,609,649 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I work on web forms . I face issue on design page print server drop down list and

branches drop down list not display on same line or rows

so How to make both drop down list on same line or rows by bootstrap or CSS.

What I have tried:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPage.aspx.cs" Inherits="TestPage.TestPage" %>

<!DOCTYPE html>

<html xmlns="">

<head runat="server">
            padding: 20px

      <script type="text/javascript" src=''></script>
    <script type="text/javascript" src=''></script>
    <link rel="stylesheet" href=''
        media="screen" />
    <form id="form1" runat="server">
        <div style="max-width: 400px;">
         <h2 class="form-signin-heading">Reprint ADC JDE Reports</h2>
         <div class="row">
             <div class='col-md-4'>
        <asp:Label ID="lblPrintServer" runat="server" Text="PrintServer"></asp:Label>
        <asp:DropDownList ID="dropPrinters" runat="server" CssClass="form-control"  AutoPostBack = "True" Width="200px" Height="32px">
             <div class='col-md-4'>
        <asp:Label ID="lblBranch" runat="server" Text="Branch"></asp:Label>
        <asp:DropDownList ID="dropBranches" runat="server" CssClass="form-control"  AutoPostBack = "True" Width="200px" Height="32px">
Updated 30-Jan-23 22:03pm
Andre Oosthuizen 31-Jan-23 4:10am    
See the bootstrap solution at

1 solution

Take off the Width and Height from both lists.

The form-control class will set the list to 100% width; if you want the labels to display on the same line as the lists, you can't put then in the same container. Either split them out into separate columns, or add another container within the col-md-4 element.
<div class="row">
    <div class='col-md-4'>
        <div style="display:flex;">
            <asp:Label ID="lblPrintServer" runat="server" Text="PrintServer"/>
            <asp:DropDownList ID="dropPrinters" runat="server" CssClass="form-control" AutoPostBack="True"/>
    <div class='col-md-4'>
        <div style="display:flex;">
            <asp:Label ID="lblBranch" runat="server" Text="Branch"/>
            <asp:DropDownList ID="dropBranches" runat="server" CssClass="form-control" AutoPostBack="True"/>
Share this answer

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