问一个关于Panel控件的滚动条做法????? 我在gridview外面加了一个panel控件,以在内容增多的时候加上滚动条但我想在页面刷的时候让滚动条的位置不变,保持在原位置.这该怎么做?网上看到的VB写的加进来,没起到效果 ,可能是我弄错了.望各位大虾们帮忙??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 css代码:.divScroll{ overflow: scroll;}Panel代码<asp:Panel ID="Panel1" runat="server" CssClass="divScroll" Height="81px" Width="398px"></asp:Panel> 把PANEL和GRIDVIEW一起放在UPDATAPANEL中,试一下 Ajax技术,就是5楼说的那个UpdatePanel就可以,楼主查点资料自己实现一下。 可以吗?我用过Ajax也不行!! 在Page上有个MaintainScrollPositionOnPostBack属性,能保证回发后回到原来的位置,你可以研究一下那个是怎么实现的~ http://www.cnblogs.com/birdshome/archive/2005/06/20/177404.html 试试选中GridView的行行不行? 弄了一下8楼提供URL这个MaintainScrollPositionOnPostBack对页面是有效的!!但对GridView外套一个DIV是无效的,郁闷!! 是啊!上面说的方法都实现不了.有一种方法,网上有的,模仿页面的MaintainScrollPositionOnPostBack做.大家都试试,试好了,来! 给你一段js代码,然后你将你的gridview单独放在一个页面,把js放到gridview的页面,不需要做什么修改!使用iframe导入那个网页!然后你运行看看!是不是就是你要的结果?<script type="text/javascript">var autoScrollOn = 1;var scrollOnFunction;var scrollOffFunction;function scrollit(){if(!parent.d.document.inputform.as.checked){autoScrollOn=0;return true;}else {autoScrollOn=1;StartUp();return true;}}function scrollWindow( ){if ( autoScrollOn == 1 ){this.scroll(0, 5000);setTimeout('scrollWindow()',200);}}function scrollOn( ){autoScrollOn = 1;scrollWindow( );}function scrollOff( ){ssautoScrollOn = 0;}function StartUp( ){this.onblur = scrollOnFunction;this.onfocus = scrollOffFunction;scrollWindow( );}scrollOnFunction = new Function('scrollOn( )')scrollOffFunction = new Function('scrollOff( )')StartUp();</script> 树的应用。 C#里怎么实现不确定类型转化? 问个服务器端生成控件的问题 关于SQL2000数据库的问题,急,在线等待 关于DataGrid中列的值?在线等! 小小问题,立即揭帖!!!!!! 多个base64编码组成的字符串如何拆分? 查找了控件!! 进者就给分!!不过得说两句? 怎样取得repeater模板列中的textbox的数据。 大量数据多字段模糊搜索优化问题 (ASP.NET(C#) + SQL Server + IIS) 熟悉 LumiSoft.Net.POP3.Client 接收邮件 的进入
.divScroll
{
overflow: scroll;
}Panel代码
<asp:Panel ID="Panel1" runat="server" CssClass="divScroll" Height="81px" Width="398px">
</asp:Panel>
我用过Ajax也不行!!
这个MaintainScrollPositionOnPostBack对页面是有效的!!
但对GridView外套一个DIV是无效的,郁闷!!
var scrollOnFunction;
var scrollOffFunction;function scrollit()
{if(!parent.d.document.inputform.as.checked){autoScrollOn=0;return true;}else {autoScrollOn=1;StartUp();return true;}}function scrollWindow( )
{if ( autoScrollOn == 1 ){this.scroll(0, 5000);setTimeout('scrollWindow()',200);}}function scrollOn( )
{autoScrollOn = 1;scrollWindow( );}function scrollOff( )
{ssautoScrollOn = 0;}function StartUp( )
{
this.onblur = scrollOnFunction;this.onfocus = scrollOffFunction;scrollWindow( );}scrollOnFunction = new Function('scrollOn( )')
scrollOffFunction = new Function('scrollOff( )')
StartUp();
</script>