ASP+SQL Server网络应用系统开发与实例

源代码在线查看: newslist.asp

软件大小: 773 K
上传用户: a956303013
关键词: Server ASP SQL 网络应用
下载地址: 免注册下载 普通下载 VIP

相关代码

				
				
				
				
				
				新闻管理
				
				
				function news90(url) {
				  var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
				  oth = oth+",width=400,height=300";
				  var news90=window.open(url,"news90",oth);
				  news90.focus();
				  return false;
				}
				
				function SelectChk()
				{
					var s=false;
					var deptid,n=0;
					var strid,strurl;
					var nn = self.document.all.item("news")
					for (j=0;j					{
						if (self.document.all.item("news",j).checked)
						{
							n = n + 1;
							s=true;
							deptid = self.document.all.item("news",j).id+"";
							if(n==1)
							{
								strid = deptid;
							}
							else
							{
								strid = strid + "," + deptid;
							}
						}
					}
				
					strurl = "NewsDelt.asp?id=" + strid;
					if(!s)	{
						alert("请选择要删除的新闻!");
						return false;
					}
					if ( confirm("你确定要删除这些新闻吗?")) {
						form1.action=strurl;
						form1.submit();
					}
				}
				function sltAll()
				{
					var nn = self.document.all.item("news");
					for(j=0;j					{
						self.document.all.item("news",j).checked = true;
					}
				}
				function sltNull()
				{
					var nn = self.document.all.item("news");
					for(j=0;j					{
						self.document.all.item("news",j).checked = false;
					}
				}
				
				
				
				
								  Dim rs
				  Set rs = Server.CreateObject("ADODB.RecordSet")
				  '按发布时间降序读取新闻
				  sql = "SELECT * FROM News ORDER BY PostTime DESC"
				  rs.Open sql, Conn, 1, 1
				  If rs.EOF Then
				    Response.Write "目前还没有新闻。"
				  Else
				%>
				新 闻 管 理 
				
				  
				   题目
				   时间
				   修改
				   选择
				  
								  '设置每页显示记录
				  rs.PageSize = 15
				  '读取当前页码
				  iPage = Request("Page")
				  If iPage 				    iPage = 1
				  End If
				  If iPage > rs.PageCount Then
				    iPage = rs.PageCount
				  End If
				  rs.AbsolutePage = iPage
				  '循环显示当前页的记录
				  For i = 1 To rs.PageSize
				%>
				  
				    
					
				    修改
				    
				  
								    rs.MoveNext() 
				    If rs.EOF Then
				      Exit For
				    End If
				
				  Next
				%>
				
								  '显示页码链接
				  If rs.PageCount>1 Then
				 	Response.Write ""
					Response.Write ""
					Response.Write "分页:"
					For i=1 to rs.PageCount
				      Response.Write ""
					  Response.Write "[" & i & "]"
					  Response.Write ""
					Next
					Response.Write ""
				  End if
				End If
				%>
						
						
						
						    
						    
				 		    
				
				
				
				
				
				
				
							

相关资源