Advertisement
Guest User

ScrollWAjax.aspx

a guest
Jun 24th, 2014
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 3.18 KB | None | 0 0
  1. <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="ScrollWAjax.aspx.cs" Inherits="_Default" MaintainScrollPositionOnPostback="true" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <link href="App_Themes/GridStyleSheet.css" rel="stylesheet" type="text/css" />
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title>Untitled Page</title>
  8.    
  9. </head>
  10. <body>
  11.     <form id="form1" runat="server">
  12.     <asp:ScriptManager ID="scriptManager" runat="server" EnablePartialRendering="True" />
  13. <script type="text/javascript" language="javascript">
  14.     var prm = Sys.WebForms.PageRequestManager.getInstance();
  15.     prm.add_pageLoaded(pageLoaded);
  16.  
  17.  
  18.     function pageLoaded(sender, args) {
  19.  
  20.         Func()
  21.  
  22.     }
  23.     function Func() {//document.getElementById("hdnScrollTop").value
  24.         document.getElementById("divScroll").scrollTop = document.getElementById("hdnScrollTop").value;
  25.     }
  26.     function Func2() {
  27.         var s = document.getElementById("divScroll").scrollTop;
  28.  
  29.         document.getElementById('hdnScrollTop').value = s;
  30.  
  31.     }
  32. </script>
  33.  
  34.  
  35.  <input type="hidden" id="hdnScrollTop" runat="server" value="0"/>
  36.         <div>
  37.             <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel1" runat="server" >
  38.                 <ContentTemplate>
  39.                
  40.                     <div runat="server" id="divScroll" style="width:559px; height:365px; overflow: scroll;" onscroll="Func2()">
  41.                         <asp:gridview id="GridView" runat="server" width="100%" cellpadding="3" GridLines="None" AutoGenerateColumns="True" BackColor="Black" BorderColor="#666666" ShowHeader="False" ForeColor="White" BorderStyle="Solid" BorderWidth="2px" Height="344px"></asp:gridview>  
  42.                     </div>
  43.                     <asp:Timer ID="Timer1" runat="server" Interval="5000" Enabled="True" OnTick="Timer1_Tick"></asp:Timer>
  44.                     <asp:Button ID="Button4" runat="server" OnClick="Button4_Click" Text="Chat" />
  45.                     <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Debug" />
  46.                     <asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="ALL" />
  47.                 </ContentTemplate>
  48.             </asp:UpdatePanel>
  49.         </div>
  50.         <script type="text/jscript" >
  51.             Func()
  52.         </script>
  53.     <%--<iframe height="500" width="500" src="http://longlostbro.com/shellinabox-2.14/shellinabox/shell_in_a_box.js" > </iframe>--%>
  54.         <div>
  55.             <asp:UpdatePanel UpdateMode="Conditional" ID="UpdatePanel2" runat="server" >
  56.                 <ContentTemplate>
  57.                     <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Send CMD" />
  58.                     <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
  59.         <asp:Button ID="Button5" runat="server" OnClick="Button5_Click" Text="Find Players Online" />
  60.                     <br />
  61.                     &nbsp;<asp:ListBox ID="ListBox1" runat="server" Height="150px" Width="584px"></asp:ListBox>
  62.                 </ContentTemplate>
  63.             </asp:UpdatePanel>
  64.         </div>
  65.     </form>
  66.     </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement