在ASP.NET中回发时维护面板滚动位置

编程入门 行业动态 更新时间:2024-10-22 18:48:35
本文介绍了在ASP.NET中回发时维护面板滚动位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

直到现在才找到任何解决方案。 嗨专家, 我遇到了问题。我有一个asp页面。我想在此页面上应用保持滚动位置。我使用过

Not find any solution till Now. Hi Experts, I am facing a problem.I have a asp page. I want to apply Maintain scroll position on this page. I have used

MaintainScrollPositionOnPostback="true"

所有树类型(在cs,aspx和web配置中)和许多其他Javascript函数(在谷歌搜索后)。但没有java脚本函数适合我。如果有人对我如何在我的页面上保持我的滚动位置有所了解。请帮助我。我google了很多,但直到现在才找到任何解决方案..例如我使用了java脚本的功能,如...

by all tree types (on cs,aspx and in web config) and many other Javascript functions (after googled).but no java script function works for me. If anyone have an Idea about how I Maintain my Scroll Position on my page .Please help Me. I googled a lots but not found any solution till now ..for example I used functions of java scripts like...

<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" /> <script type="text/javascript"> var xPos, yPos; var prm = Sys.WebForms.PageRequestManager.getInstance(); function BeginRequestHandler(sender, args) { if ($get('<%=Panel1.ClientID%>') != null) { xPos = $get('<%=Panel1.ClientID%>').scrollLeft; yPos = $get('<%=Panel1.ClientID%>').scrollTop; } } function EndRequestHandler(sender, args) { if ($get('<%=Panel1.ClientID%>') != null) { $get('<%=Panel1.ClientID%>').scrollLeft = xPos; $get('<%=Panel1.ClientID%>').scrollTop = yPos; } } prm.add_beginRequest(BeginRequestHandler); prm.add_endRequest(EndRequestHandler); </script> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Panel ID="Panel1" runat="server" Height="300"> <----"my html table code here which have drop down,textbox,radiobutton,button etc controls"-----> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> and many othes functions. Thanks </form>

推荐答案

get(' <%= Panel1.ClientID%>')!= null ) { xPos = get('<%=Panel1.ClientID%>') != null) { xPos =

get(' <%= Panel1 .ClientID%GT;')scrollLeft。 yPos = get('<%=Panel1.ClientID%>').scrollLeft; yPos =

get(' <%= Panel1。的ClientID%GT;')scrollTop的。 } } 函数EndRequestHandler(sender,args){ if ( get('<%=Panel1.ClientID%>').scrollTop; } } function EndRequestHandler(sender, args) { if (

更多推荐

在ASP.NET中回发时维护面板滚动位置

本文发布于:2023-11-25 02:14:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627906.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:面板   位置   ASP   NET   中回发时

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!