zoukankan      html  css  js  c++  java
  • ASP.NET 2.0中新增加了2个很实用的属性和方法

    ASP.NET 2.0中新增加了2个很实用的属性和方法:

    SetFocus()用来将光标聚焦到某个页面控件上
    <%@ page language="C#" %>

    <script runat="server">
        
    void Page_Init(object sender, EventArgs e)
        
    {
            SetFocus(focusHere);
        }

    </script>

    <html>
    <head id="Head1" runat="server">
        
    <title>Untitled Page</title>
    </head>
    <body>
        
    <form id="form1" runat="server">
            
    <asp:textbox id="default" runat="server" /><br />
            
    <asp:textbox id="focusHere" runat="server" />
        
    </form>
    </body>
    </html>


    MaintainScrollPositionOnPostback 设置成true可以在页面PostBack的时候保持页面滚动条的位置

    在web.config作如下设置即可:
    <pages smartNavigation="true" maintainScrollPositionOnPostBack="true"/>
  • 相关阅读:
    生成器,生成器表达式。
    device busy
    memcached
    ps f
    Eviews9.0---软件安装
    免费提取百度文库 doc 文件
    Matlab---length函数
    Matlab 路径函数
    matlab中disp函数的简单用法
    MATLAB---dir函数
  • 原文地址:https://www.cnblogs.com/skyblue/p/808364.html
Copyright © 2011-2022 走看看