473,498 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to code for paging using server side java script with classic asp

2 New Member
Expand|Select|Wrap|Line Numbers
  1. <% @Language="JavaScript" %>
  2. <html>
  3. <head><title> User Register Details</title>
  4. <script language="JavaScript" type="text/JavaScript">
  5.  
  6. function load()
  7. {
  8. var co =document.getElementById('coname');
  9. var so=document.getElementById('sorder');
  10. var cur=document.getElementById('curpage');
  11. var dir=document.getElementById('direction');
  12. var wsql=document.getElementById('whsql');
  13. co.value="";
  14. so.value="Asc";
  15. cur.value=1;
  16. dir.value="";
  17. wsql.value=""
  18. }
  19. function next()
  20. {
  21.  
  22. var co =document.getElementById('coname');
  23.  
  24. var so=document.getElementById('sorder');
  25. var cur=document.getElementById('curpage');
  26. var dir=document.getElementById('direction');
  27. var wsql=document.getElementById('whsql');
  28. co.value="FirstName";
  29. so.value="Asc";
  30. cur.value=1;
  31. dir.value="Next";
  32. wsql.value=""
  33.  
  34. }
  35.  
  36.  
  37.  
  38. </script>
  39. </head>
  40. <body>
  41. <div>
  42.  
  43. <form action="demo.asp" onload="javascript:load();" method ="Post" >
  44.  
  45. <input type="hidden"  id= "coname" name="colname" value= " " Size="20" maxlength="10" runat="server" />
  46. <input type="hidden"  id= "sorder" name="sorder" value= " " Size="20" maxlength="10" runat="server" />
  47. <input type="hidden"  id= "curpage" name="curpage" value= " " Size="20" maxlength="10" runat="server" />
  48. <input type="hidden"  id= "direction" name="direction" value= " " Size="20" maxlength="10" runat="server"  />
  49. <input type="hidden"  id= "whsql" name="whsql" value= " " Size="20" maxlength="10" runat="server"  />
  50.  
  51. <input type="image" id="First" name="First"  src="First1.gif" runat="server" />
  52. <input type="image" id="Previous" name="Previous"  src="previous1.gif" runat="server" />
  53. <input type="image" id="next" name="next" src="next1.gif" onclick="javascript:next();" runat="server" />
  54. <input type="image" id="Last" name="Last"  src="Last1.gif" runat="server" />
  55.  
  56. <%
  57.  
  58. var Connection = new ActiveXObject("ADODB.Connection");
  59. var Recordset = new ActiveXObject("ADODB.Recordset");
  60. var Ls_SQL;
  61. var  NumPerPage = 4;
  62.  
  63.  
  64.  
  65.  
  66. var strConn ="DSN=a;UID=sa;PWD=SageCRM72;Database=RegisterDB";
  67. Connection.Open(strConn);
  68. Ls_SQL = "SELECT FirstName,LastName,UserName,Password,EmailId,PhoneNo,Address1,Address2,Country,State,City FROM Register order by FirstName asc"
  69. Recordset.Open(Ls_SQL,Connection);
  70.  
  71. %>
  72.  
  73. <table width=100% align=center border=1>
  74. <tr>
  75. <td align=center><a href="demo.asp">FirstName</a></td>
  76. <td align=center><a href="demo.asp">LastName</a></td>
  77. <td align=center><a href="demo.asp">UserName</a></td>
  78. <td align=center><a href="demo.asp">Password</a></td>
  79. <td align=center><a href="demo.asp">EmailId</a></td>
  80. <td align=center><a href="demo.asp">PhoneNo</a></td>
  81. <td align=center><a href="demo.asp">Address1</a></td>
  82. <td align=center><a href="demo.asp">Address2</a></td>
  83. <td align=center><a href="demo.asp">Country</a></td>
  84. <td align=center><a href="demo.asp">State</a></td>
  85. <td align=center><a href="demo.asp">City</a></td>
  86. </tr>
  87.  
  88. <tr>
  89. <%while(!Recordset.EOF)
  90. %>
  91.  
  92. <td>
  93. <%
  94. Response.Write(Recordset.Fields("FirstName")); 
  95.  
  96. %>
  97. </td> 
  98. <td>
  99. <%
  100. Response.Write(Recordset.Fields("LastName")); %>
  101. </td>
  102. <td>
  103. <%Response.Write(Recordset.Fields("UserName")); %>
  104. </td>
  105. <td>
  106. <%
  107. Response.Write(Recordset.Fields("Password")); %>
  108. </td>
  109. <td>
  110. <%Response.Write(Recordset.Fields("EmailId")); %>
  111. </td>
  112. <td>
  113. <%Response.Write(Recordset.Fields("PhoneNo")); %>
  114. </td>
  115. <td>
  116. <%Response.Write(Recordset.Fields("Address1")); %>
  117. </td>
  118. <td>
  119. <%Response.Write(Recordset.Fields("Address2")); %>
  120. </td>
  121. <td>
  122. <%Response.Write(Recordset.Fields("Country")); %>
  123. </td>
  124. <td>
  125. <%Response.Write(Recordset.Fields("State")); %>
  126. </td>
  127. <td>
  128. <%Response.Write(Recordset.Fields("City")); %>
  129. </td></tr> 
  130. <%
  131. Recordset.MoveNext ;
  132. }
  133. %>
  134.  
  135. <%
  136. Recordset.Close();
  137. Connection.Close();
  138.  
  139. %>
  140.  
  141. </table>
  142. </form>
  143. </div>
  144. </body>
  145. </html>
  146.  
  147.  
  148.  
  149.  
  150.  
Jan 22 '14 #1
0 1431

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3182
by: Jim Mitchell | last post by:
OK, have I come full circle.... ? 1) .NET with VS Studio seemed to be the answer to all my prayers. A) No more worries about coding for Netscape vs. IE. B) Quick Deployment C) All code in...
3
1567
by: Rea Peleg | last post by:
Hello I'd like to use .NET framework namespaces in client side java script. For example i'd like to import System.Activator, in order to call Activator.CreateInstance() method inside a client side...
1
1599
by: jrefactors | last post by:
how client-side presentation code interact with server-side filter/sort processing code? I have a html table that has sorting and filter capabilities. The sorting and filter features are done...
2
1937
by: Rea Peleg | last post by:
Hi all Is it possible to handle web controls events on client side??? I wrote a simple favascript function inside the <header> area of an aspx web form. This function is called on...
3
2365
by: ATS | last post by:
HOWTO Post to a URL from Server Side ASP script. Please help, I'm trying to make a simple ASP page post to a URL on a seperate web site, and then get the returned HTML into a string which on...
0
1311
by: johnlim20088 | last post by:
Anyone can help me? Can I use C# Code in SQL Server Integration Services -Script Component Manager
5
13098
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called...
1
2364
by: pdesai007 | last post by:
hello, i tried to upload an image in to server with asp and java script ( using AJAX) but it gave an error. so please give me any solution that help me to upload an image to server with java...
3
987
by: ubohra | last post by:
Hii all I am getting stuck into some development issue!! We are using some application which provides support to our clients,the user comes and take some courses for them. The problem is...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.