每当可见时,ASP.net日历都会移动页面上的组件

本文关键字:移动 组件 日历 net ASP | 更新日期: 2023-09-27 18:22:48

我有一个ASP页面,当单击图像按钮时,页面上会显示(设置为可见)一个日历。问题是,每次显示日历时,它都会向下移动页面上的其他组件,而当它是不可见的组件时,它会再次向上移动。有人能给我一个主意吗?plz。这是我最后做的:(现在已经修复了)

<body>
<form id="form1" runat="server">

    <asp:TextBox ID="CreationTimeTextBox" runat="server" ClientIDMode="Static">Creation Time</asp:TextBox><br />
    <script>
        AnyTime.picker("CreationTimeTextBox",
          { format: "%d/%m/%z %h:%i", firstDOW: 1 });
    </script>
    <asp:TextBox ID="EndTimeTextBox" runat="server" ClientIDMode="Static">End Time</asp:TextBox>
    <script>
        AnyTime.picker("EndTimeTextBox",
          { format: "%d/%m/%z %h:%i", firstDOW: 1 });
    </script>
    <asp:Button ID="btnResetSearchInput" runat="server" Text="   Reset search input" CssClass="resetBtn" Width="140px" OnClick="btnResetSearchInput_Click" />

每当可见时,ASP.net日历都会移动页面上的组件

为了不向下移动页面的其余部分,日历必须具有正确的样式,允许他在页面上显示为伪对话框。

css上必须正确设置的主要属性是positiontopleft

以下是一个示例:

.dialog {
    position: absolute;
    top:10px;
    left:20px;
    width: 140px;
    height: 30px;    
    
    background-color:blue;
    color:white;
}
.NotDialog {
    width: 200px;
    height: 30px;    
    
    background-color:blue;
    color:white;
}
<div>Some other text before
     <div class="dialog">open as dialog</div>    
    and after the dialog
</div>
<div>
  Some other text below the blue dialog 
<div>
<br><br><br>
<div>Some other text before
     <div class="NotDialog">open by moving the text down</div>    
    and after the dialog
</div>
<div>
  Some other text below the blue dialog 
<div>

更多可阅读内容

CSS叠加技术