Vertical seperator in aspx page in asp.net c#

1.2k views Asked by At

I want to display buttons arranged in vertical arrangements and vertical separator and right side have gridview.

I tried below code. But nothing changes happened.

 <body bgcolor="#CCFFFF">
        <form id="form1" runat="server">  
    <!--Right side of webpage -->
       <div>
         <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
               Text="ImportData to Database" Width="187px"            
               style="top: 40px; left: 228px; position: absolute; height: 29px; right: 824px;" />      

        <asp:DropDownList ID="MonthList" runat="server" 
            onselectedindexchanged="MonthList_SelectedIndexChanged"  
            style="top: 141px; left: 380px; position: absolute; height: -5px; width: 95px; ">
        </asp:DropDownList> 

        <asp:GridView ID="GridView1" runat="server" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            style="top: 244px; left: 256px; position: absolute; height: 152px; width: 287px"> 
             <columns>         
                    <asp:templatefield HeaderText="Select">
                        <itemtemplate>
                            <asp:checkbox ID="cbSelect"  runat="server"></asp:checkbox>
                        </itemtemplate>
                    </asp:templatefield>                
                </columns>
        </asp:GridView>
     </div>
    <!--Left side -->
        <div style="float:left; width:30%;">
        <asp:Button ID="Userbtn" runat="server" Text="User Settings"       
            style="top: 87px; left: 14px; position: absolute; height: 29px; width: 145px" />
        <asp:Button ID="EmployeeBtn" runat="server" 
            style="top: 40px; left: 14px; position: absolute; height: 29px; width: 143px" 
            Text="Add Employee " />
         </div>

     </form>
2

There are 2 answers

0
ssneha On

Check with this code:

<body bgcolor="#CCFFFF">
    <form id="form1" runat="server">  
        <!--Right side of webpage -->
           <div style="float:left; width:70%;">
             <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                   Text="ImportData to Database" Width="187px"            
                   style="top: 40px; left: 228px; position: absolute; height: 29px; right: 824px;" />      

            <asp:DropDownList ID="MonthList" runat="server" 
                onselectedindexchanged="MonthList_SelectedIndexChanged"  
                style="top: 141px; left: 380px; position: absolute; height: -5px; width: 95px; ">
            </asp:DropDownList> 

            <asp:GridView ID="GridView1" runat="server" 
                onselectedindexchanged="GridView1_SelectedIndexChanged" 
                style="top: 244px; left: 256px; position: absolute; height: 152px; width: 287px"> 
                 <columns>         
                        <asp:templatefield HeaderText="Select">
                            <itemtemplate>
                                <asp:checkbox ID="cbSelect"  runat="server"></asp:checkbox>
                            </itemtemplate>
                        </asp:templatefield>                
                    </columns>
            </asp:GridView>
         </div>

        <!--Left side -->
          <div style="float:left; width:30%;">
            <asp:Button ID="Userbtn" runat="server" Text="User Settings" style="top: 87px; left: 14px; position: absolute; height: 29px; width: 145px" />
            <asp:Button ID="EmployeeBtn" runat="server" 
                style="top: 40px; left: 14px; position: absolute; height: 29px; width: 143px" 
                Text="Add Employee " />
          </div>

 </form>

1
AudioBubble On

Following code should work

<body bgcolor="#CCFFFF">
    <form id="form1" runat="server">
   
             <!--Left side -->
        <div style="float:left; width:30%;">
        <asp:Button ID="Userbtn" runat="server" Text="User Settings"       
            style="top: 87px; left: 14px; position: absolute; height: 29px; width: 145px" />
        <asp:Button ID="EmployeeBtn" runat="server" 
            style="top: 40px; left: 14px; position: absolute; height: 29px; width: 143px" 
            Text="Add Employee " />
         </div>
      
        <!-- Right Side -->
   
         <div style="float:right; border-left:5px solid #000000;" width:70%;" >
   
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
               Text="ImportData to Database" Width="187px"            
               style="top: 40px; left: 228px; position:static; height: 29px; margin-left:10px; " />      
    <br />
        <asp:DropDownList ID="MonthList" runat="server" 
            onselectedindexchanged="MonthList_SelectedIndexChanged"  
            style="top: 141px; left: 380px; position: inherit; height: -5px; width: 95px; ">
        </asp:DropDownList> <br />

        <asp:GridView ID="GridView1" runat="server" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            style="top: 244px; left: 256px; position: static; height: 152px; width:287px; margin-left:10px; margin-bottom:25px;"> 
             <columns>         
                    <asp:templatefield HeaderText="Select">
                        <itemtemplate>
                            <asp:checkbox ID="cbSelect"  runat="server"></asp:checkbox>
                        </itemtemplate>
                    </asp:templatefield>                
                </columns>
        </asp:GridView>

        </div>
  </form>
</body>