asp.net 锚点
2015-12-22 22:55
656 查看
可以使用锚点,但这里可使用灵活处理
首先获取需要滚动到的位置的id,如,可以设置一个元素(,注:要在form里),另外在form的任意位置设置
代码如下:
注:a标签里不要有内容,在回传的地方调用
代码如下:
Page.ClientScript.RegisterStartupScript(this.GetType(), "scroll", "document.getElementById('clickLink').click();", true);
1.设置Page中的MaintainScrollPositionOnPostback属性为true
A>.页面里有MaintainScrollPositionOnPostback,默认是false,设为true即可(页面级)
代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" MaintainScrollPositionOnPostback="true" Inherits="Default.Defa
ult" %>
首先获取需要滚动到的位置的id,如,可以设置一个元素(,注:要在form里),另外在form的任意位置设置
代码如下:
注:a标签里不要有内容,在回传的地方调用
代码如下:
Page.ClientScript.RegisterStartupScript(this.GetType(), "scroll", "document.getElementById('clickLink').click();", true);
1.设置Page中的MaintainScrollPositionOnPostback属性为true
A>.页面里有MaintainScrollPositionOnPostback,默认是false,设为true即可(页面级)
代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" MaintainScrollPositionOnPostback="true" Inherits="Default.Defa
ult" %>
相关文章推荐
- asp.net环境下的静态类以及静态变量
- 改jsp、html、asp的网页图标
- Aspose.Words 总结
- [转贴] ASP.NET -- Web Service (.asmx) & JSON
- 小图示优化 - ASP.NET Sprite and Image Optimization (Web Form)
- 检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法
- Page_Load与sender -- PostBack是由哪个 ASP.NET控件引起 ?
- ASP.NET(Web Form)绘制图表 -- Google Chart 三部曲
- Action与func委托的区别有哪些
- ASP.NET MVC开发中常见异常及解决方案
- ASP.NET GridView控件固定表头(适用于IE浏览器,css操作)
- kafkaspout以及kafkabolt的最简实例
- Easyui Tree + Asp.net加载数据
- Asp.net 生成 导出 Excel 下载
- asp、php、asp.net、jsp介绍及优缺点比较
- asp.net mvc情况下使用jqery ajax的方法进行json数据传递
- ASP.NET: Setup a MVC5 website with MySQL, Entity Framework 6 Code-First and VS2013
- casperjs# install
- asp.net前台ListView中判断CheckBox选中状态
- 在ASP.NET Web API中实现CORS(跨域资源共享)