Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 28, 2013 03:26 AM by raghavendra ms
Member
36 Points
218 Posts
Feb 27, 2013 08:49 AM|LINK
Is there anyway I could corrently allign label and textbox
<asp:Label ID="Label2" runat="server" CssClass="newsSummary" Text="Surname:"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br /> <asp:Label ID="Label3" runat="server" CssClass="newsSummary" Text="Unitno:"></asp:Label> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> <asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Bottom" ImageURL="~/Images/search.jpg" ToolTip="Search"/>
Thanks
Contributor
7046 Points
1376 Posts
Feb 27, 2013 08:53 AM|LINK
You can use HTMl tables
http://www.w3schools.com/html/html_tables.asp
Or can also design div based page
http://stackoverflow.com/questions/13514665/div-based-designing-of-an-html-page
4054 Points
902 Posts
Feb 27, 2013 08:58 AM|LINK
!!REMOVED!!
thanks.... the labels and textboxes are all over the place... what am i doing wrong
Participant
1890 Points
435 Posts
Feb 27, 2013 09:00 AM|LINK
Put all the controls into HTML Table like
<div> <table width="100% cellpadding="0px" cellspacing="0"> <tr><td> <asp:Label ID="Label2" runat="server" CssClass="newsSummary" Text="Surname:"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td><td> <asp:Label ID="Label3" runat="server" CssClass="newsSummary" Text="Unitno:"></asp:Label> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> </td><td> <asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Bottom" ImageURL="~/Images/search.jpg" ToolTip="Search"/> </td></tr> </table> </div>
Feb 27, 2013 09:21 AM|LINK
how do I incoporate the following panel also
<asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <%--<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION"> </asp:DropDownList>--%> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> </ContentTemplate> </asp:UpdatePanel>
Feb 27, 2013 09:30 AM|LINK
Try this
<div> <asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <table width="100%", cellpadding="0px" cellspacing="0px"> <tr><td> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> </td></tr> <tr><td> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <%--<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION"> </asp:DropDownList>--%> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> </td></tr> </table> </ContentTemplate> </asp:UpdatePanel> </div>
812 Points
258 Posts
Feb 27, 2013 09:33 AM|LINK
Press cntrl+KD
Just Add one div tag .and pit inside your code.
Dont use Table tr td .Its not good standared.Use div
<div> <asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <div> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <%--<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION"> </asp:DropDownList>--%> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> <div> </ContentTemplate> </asp:UpdatePanel> </div>
Feb 27, 2013 09:55 AM|LINK
how do i incoporate both of them together in a single row?
<div> <asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <div> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> <div> </ContentTemplate> </asp:UpdatePanel> </div>
with this one
<div> <table width="40%" cellpadding="0px" cellspacing="0"> <tr> <td> <asp:Label ID="Label2" runat="server" CssClass="newsSummary" Text="Surname:"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td> <td> <asp:Label ID="Label3" runat="server" CssClass="newsSummary" Text="Unitno:"></asp:Label> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> </td> <td> <asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Bottom" ImageUrl="~/Images/search.jpg" ToolTip="Search" /> </td> </tr> </table> </div>
1358 Points
321 Posts
Feb 27, 2013 09:59 AM|LINK
Hi,
Below i did for text box like the same , your try and complete
Use this,
for example: Create CSS, in that create class named "cssclass" in that part give the code like below
.cssclass { text-align: center ; }
and then in the aspx page do like following
<div class="cssclass "> <asp:Label ID="lblmesssage" Text="Text" ForeColor="Red" runat="server"></asp:Label> </div>
If you found difficulties using this you can use code like below
To align the textstyle="text-align:center"
do like this,
<div style="text-align: center; " > <asp:Label ID="lblmesssage" Text="Text" ForeColor="Red" runat="server"></asp:Label> </div>
sam233
Member
36 Points
218 Posts
Aligning Labels and Textboxes
Feb 27, 2013 08:49 AM|LINK
Is there anyway I could corrently allign label and textbox
<asp:Label ID="Label2" runat="server" CssClass="newsSummary" Text="Surname:"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <br /> <asp:Label ID="Label3" runat="server" CssClass="newsSummary" Text="Unitno:"></asp:Label> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> <asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Bottom" ImageURL="~/Images/search.jpg" ToolTip="Search"/>Thanks
sameer_khanj...
Contributor
7046 Points
1376 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 08:53 AM|LINK
You can use HTMl tables
http://www.w3schools.com/html/html_tables.asp
Or can also design div based page
http://stackoverflow.com/questions/13514665/div-based-designing-of-an-html-page
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.
tarun n june...
Contributor
4054 Points
902 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 08:58 AM|LINK
!!REMOVED!!
Cheers!
Tarun Juneja
http://meghainfotech.wordpress.com/
sam233
Member
36 Points
218 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 08:58 AM|LINK
thanks.... the labels and textboxes are all over the place... what am i doing wrong
raghavendra ...
Participant
1890 Points
435 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 09:00 AM|LINK
Put all the controls into HTML Table like
sam233
Member
36 Points
218 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 09:21 AM|LINK
how do I incoporate the following panel also
<asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <%--<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION"> </asp:DropDownList>--%> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> </ContentTemplate> </asp:UpdatePanel>raghavendra ...
Participant
1890 Points
435 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 09:30 AM|LINK
Try this
<div> <asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <table width="100%", cellpadding="0px" cellspacing="0px"> <tr><td> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> </td></tr> <tr><td> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <%--<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION"> </asp:DropDownList>--%> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> </td></tr> </table> </ContentTemplate> </asp:UpdatePanel> </div>rajendraram
Participant
812 Points
258 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 09:33 AM|LINK
Press cntrl+KD
Just Add one div tag .and pit inside your code.
Dont use Table tr td .Its not good standared.Use div
<div> <asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <div> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <%--<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION"> </asp:DropDownList>--%> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> <div> </ContentTemplate> </asp:UpdatePanel> </div>sam233
Member
36 Points
218 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 09:55 AM|LINK
how do i incoporate both of them together in a single row?
<div> <asp:UpdatePanel ID="updatepanel1" runat="server"> <ContentTemplate> <div> <asp:Label ID="Label1" runat="server" Text="Faith Group:" CssClass="newsSummary"></asp:Label> <asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox> <asp:PopupControlExtender ID="TextBox2_PopupControlExtender" runat="server" Enabled="True" ExtenderControlID="" TargetControlID="TextBox2" PopupControlID="Panel1" OffsetY="22"> </asp:PopupControlExtender> <asp:Panel ID="Panel1" runat="server" Height="116px" Width="245px" BorderStyle="Solid" BorderWidth="1px" Direction="LeftToRight" ScrollBars="Auto" BackColor="#CCCCCC" Style="display: none"> <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="FaithGroup" DataTextField="DESCRIPTION" DataValueField="DESCRIPTION" AppendDataBoundItems="True"> <asp:ListItem Value="All" Selected="True">All</asp:ListItem> </asp:CheckBoxList> </asp:Panel> <div> </ContentTemplate> </asp:UpdatePanel> </div>with this one
<div> <table width="40%" cellpadding="0px" cellspacing="0"> <tr> <td> <asp:Label ID="Label2" runat="server" CssClass="newsSummary" Text="Surname:"></asp:Label> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> </td> <td> <asp:Label ID="Label3" runat="server" CssClass="newsSummary" Text="Unitno:"></asp:Label> <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox> </td> <td> <asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Bottom" ImageUrl="~/Images/search.jpg" ToolTip="Search" /> </td> </tr> </table> </div>farooque84
Participant
1358 Points
321 Posts
Re: Aligning Labels and Textboxes
Feb 27, 2013 09:59 AM|LINK
Hi,
Below i did for text box like the same , your try and complete
Hi,
Use this,
for example: Create CSS, in that create class named "cssclass" in that part give the code like below
.cssclass
{
text-align: center ;
}
and then in the aspx page do like following
<div class="cssclass ">
<asp:Label ID="lblmesssage" Text="Text" ForeColor="Red" runat="server"></asp:Label>
</div>
If you found difficulties using this you can use code like below
To align the textstyle="text-align:center"
do like this,
<div style="text-align: center; " >
<asp:Label ID="lblmesssage" Text="Text" ForeColor="Red" runat="server"></asp:Label>
</div>