c# – 保持页面位置在回发

嗨,你们正在为这个学校的项目工作,有一个问题
<asp:LinkButton ID="LinkEdit" runat="server" CssClass="right_bottom" 
        onclick="LinkEdit_Click" Height="16px">edit</asp:LinkButton>
    <asp:LinkButton ID="Linkhide" runat="server" CssClass="right_bottom" 
        onclick="Linkhide_Click" Visible="False" hide</asp:LinkButton>
    <br />
    <hr style="width: 740px; height: -6px; margin-left: 0px; " />
    <asp:Label ID="labelFullname" runat="server" Text="Full Name" CssClass="left_top"></asp:Label>
    <asp:Label ID="labelNamedisplay" runat="server" Text="Put name here" CssClass="right_top"></asp:Label>

    <br />
    <asp:Panel ID="panelName" runat="server" Height="240px" Visible="False" CssClass="panel_top"
        style="text-align: left;">

        <asp:Label ID="Label8" runat="server" CssClass="left" Text="Please allow 24 hours for name changes to take effect."></asp:Label>
    <div align="center"><br />
    <br />
    <table>
       <tr>
       <td class="label_new">
         <asp:Label ID="Label4" runat="server" Text="Full Name:" ToolTip="Name displayed"></asp:Label>
         </td>
         <td align="left">

          <asp:DropDownList ID="DropDownList1"  runat="server" BorderStyle="Groove" 
                 Font-Names="Segoe UI,Tahoma,Verdana,Arial,Times" Font-Size="100%" Height="25px" 
          valign="middle" Width="250px">
              <asp:ListItem></asp:ListItem>
              <asp:ListItem></asp:ListItem>
              <asp:ListItem></asp:ListItem>
          </asp:DropDownList>
       </td>
  </tr>


   <tr>
       <td class="label_new">
         <asp:Label ID="Label2" runat="server" Text="First Name:"></asp:Label>
         </td>
         <td align="left">
         <asp:TextBox ID="txtFirstName" runat="server" BorderStyle="Groove" Font-Names="Segoe UI,Times" Font-Size="100%" Height="20px" 
          valign="middle" Width="242px"></asp:TextBox>
       </td>
  </tr>

     <tr>
       <td class="label_new">
         <asp:Label ID="Label9" runat="server" Text="Middle Name:"></asp:Label>
         </td>
         <td align="left">
         <asp:TextBox ID="txtMiddleName" runat="server" BorderStyle="Groove" Font-Names="Segoe UI,Times" Font-Size="100%" Height="20px" 
          valign="middle" Width="242px" onfocus="if (this.value == 'optional') {   this.value='';  this.style.color='black';}" />
       </td>
  </tr>

     <tr>
       <td class="label_new">
         <asp:Label ID="Label10" runat="server" Text="Last Name:"></asp:Label>
         </td>
         <td align="left">
         <asp:TextBox ID="txtLastName" runat="server" BorderStyle="Groove" Font-Names="Segoe UI,Times" Font-Size="100%" Height="20px" 
          valign="middle" Width="242px"></asp:TextBox>
       </td>
  </tr>
  <tr>
  <td colspan="2">
      <asp:Button ID="btnSaveChanges" runat="server" Text="Save Changes" 
          onclick="btnSaveChanges_Click" />
  </td>
  </tr>
    </table>
    </div>

    </asp:Panel>

我有4个面板,这个格式就像在Facebook上的帐户设置.
我的问题是,当我显示面板,它只是跳到页面的顶部.

愿意像Facebook一样做.点击并点击您点击的位置.

谢谢

解决方法

您可以在页面上设置MaintainScrollPositionOnPostback属性
Page.MaintainScrollPositionOnPostback = true;

或将其放在页面声明中

<%@ Page MaintainScrollPositionOnPostback="true" %>

相关文章

在要实现单例模式的类当中添加如下代码:实例化的时候:frmC...
1、如果制作圆角窗体,窗体先继承DOTNETBAR的:public parti...
根据网上资料,自己很粗略的实现了一个winform搜索提示,但是...
近期在做DSOFramer这个控件,打算自己弄一个自定义控件来封装...
今天玩了一把WMI,查询了一下电脑的硬件信息,感觉很多代码都...
最近在研究WinWordControl这个控件,因为上级要求在系统里,...