对齐.aspx按钮

时间:2012-10-09 14:54:55

标签: asp.net css

我有一个更新面板,其中包含一个标签,一个dropDownList和两个按钮:

 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div id="dropDownList" style="position:relative;" runat="server">
            <label>
                    Select New File: </label>
                    <div id="ddl" runat="server">
                <asp:DropDownList runat="server" ID="ddlCaseFiles" DataSourceID="dsMyCaseFiles" DataTextField="Display"
                    DataValueField="FileID" OnPreRender="ddl_PreRender" Width="524px" OnSelectedIndexChanged="ddlCaseFiles_SelectedIndexChanged" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCaseFiles"
                    ToolTip="Casefile Required" InitialValue="-1" Text="*" Display="Dynamic" />
                <ajaxToolkit:ListSearchExtender ID="ddlExtCaseFiles" runat="server" PromptCssClass="ListSearchExtenderPrompt"
                    TargetControlID="ddlCaseFiles" BehaviorID="ddlExtCaseFiles" Enabled="True" />
                    </div>
                <br />
                <asp:Button ID="btnMoveCaseFile" runat="server" Text="" 
                   style="float:left;" onclick="btnMoveCaseFile_Click"/>
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                   style="float:right" onclick="btnCancel_Click"/>
                   <br />
            </div>
                   <asp:Label runat="server" ID="lblStatus"></asp:Label>
        </ContentTemplate>

我试图按下这样的按钮:( DropDownList开头的按钮和结束时的按钮) enter image description here

我已经尝试过float-absolute等。

1 个答案:

答案 0 :(得分:0)

我明白了。似乎你必须在数字后添加px .....

 <asp:Button ID="btnMoveCaseFile" runat="server" Text="" 
                   style="position:absolute; float:left; margin-left:104px;" onclick="btnMoveCaseFile_Click"/>
                <asp:Button ID="btnCancel" runat="server" Text="Cancel" 
                   style="position:relative; float:right; margin-right:63px;"

因为我有保证金权利:63;而不是margin-right:63px;