惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
NISL@THU
NISL@THU
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tenable Blog
Forbes - Security
Forbes - Security
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
Schneier on Security
Schneier on Security
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
PCI Perspectives
PCI Perspectives
O
OpenAI News
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
D
Docker
AI
AI
Blog — PlanetScale
Blog — PlanetScale
S
Security @ Cisco Blogs
S
Schneier on Security
The GitHub Blog
The GitHub Blog
W
WeLiveSecurity
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
C
Check Point Blog
A
About on SuperTechFans
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Engineering at Meta
Engineering at Meta
I
InfoQ
T
Threat Research - Cisco Blogs
Project Zero
Project Zero
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
S
Securelist

博客园 - 1werwerfer

ADO.NET中的Transaction asp.net 2.0在使用了mater page的情况下Form defaultbutton无法设置的问题 - 1werwerfer SQL Server 索引结构及其使用(四) SQL Server 索引结构及其使用(三) SQL Server 索引结构及其使用(二) SQL Server 索引结构及其使用(一) 如何作正确的询价--不可忽视的国际贸易中的"贸易条件" - 1werwerfer - 博客园 智猪博弈与企业技术创新决策 为 IIS 创建证书需要安装证书服务吗? MSI文件制作全过程 如何将Windows Server 2003映像安装到Windows Server 2003 RIS服务器 Asp.Net中使用水晶报表 经典正则表达式 使用System.DirectoryServices.Protocols实现对AD的简单操作 备份Exchange server存储组有效减少LOG文件 如何将SQL Server表驻留内存和检测 A Simple Tip on SQL Server Stored Procedure 无盘网络技术详解 如何面对呼叫中心的风险?
使用ASP.NET 2.0新增加的SetFocus和MaintainScrollPositionOnPostback增强用户体验 - 1werwerfer - 博客园
1werwerfer · 2006-02-17 · via 博客园 - 1werwerfer

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"/>