ASP.NET 生成静态页面
因为公司的产品用asp开发, 前一段时间用asp写了一个生成静态页面并分页的程序,但缘于对.net的热爱,写了这个.net下的生成静态页面并分页的程序。
主要的原理就是替换模板里的特殊字符。
1、静态模板页面 template.html,主要是定义了一些特殊字符,用来被替换。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>$Title</title>
</head>
<body>
<div style="width: 417px; height: 54px" align="center">
<br />
$Title</div>
<div style="width: 417px; height: 8px">
浏览<font color="red"><script src="http://localhost/.Net/NewsFiles/ClickCount.aspx?NewsId=$NewsId"></script></font>次 $Time</div>
<div style="width: 417px; height: 100px">
$Content</div>
<div style="width: 416px; height: 9px">
$Pager</div>
<div style="width: 416px; height: 8px">
<form id="form1" action="../AddComment.aspx" style="margin:0px">
<input id="Text1" type="text" /><Img id="Image1" src="../../UserInfo/CheckCode.aspx"/><br />
<textarea id="CommentContent" cols="20" rows="2"></textarea>
 
相关文档:
在用VS2008调试网站的时候,突然页面不能正常显示了,IE显示“无法显示该网页”。
症状一:
IE地址栏里面显示的端口号和桌面任务栏右下角“ASP.NET Development Server”的端口不一致,而把IE地址栏的端口号改成“ASP.NET Development Server”显示的端口号,结果网页就能出来。
解决 ......
分页存储过程如下代码Pages.sql:
CREATE PROCEDURE Pages
@tblName varchar(255), -- 表名
@strGetFields varchar(1000) = '*', -- 需要返回的列
@fldName varchar(255)='', -- 排序的字段名
@pageSize int = 10, -- 页尺寸
@pageIndex int = 1, -- 页码
@doCount ......
asp.net允许上传的文件的最大为4M
如果想要传更大的需要更改web.config文件
<system.web>
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
</ststem.web> ......
web.config
<customErrors mode="On" defaultRedirect="ApplicationErroy.aspx" >
<error statusCode="403" redirect="403.htm"/>
<error statusCode="404" redirect="404.htm"/>
<error statusCode= ......
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JqueryAjaxLongPoll.aspx.cs" Inherits="JqueryAjaxLongPoll" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" & ......