对齐.aspx按钮

4jb9z9bj  于 2023-01-27  发布在  .NET
关注(0)|答案(1)|浏览(163)

我有一个更新面板,其中包含一个标签、一个下拉列表和两个按钮:

<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开头的按钮和结尾的按钮)

我试过浮式净油等。

sqxo8psd

sqxo8psd1#

我算出来了。好像你要在数字后面加上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;代替右边距:63 px;

相关问题