web.config
<customErrors mode="On" defaultRedirect="ApplicationErroy.aspx" >
<error statusCode="403" redirect="403.htm"/>
<error statusCode="404" redirect="404.htm"/>
<error statusCode="500" redirect="500.htm"/>
</customErrors>
Global.asax
<%@ Application Language="C#" %>
<mce:script runat="server"><!--
void Application_Start(object sender, EventArgs e)
{
// ÔÚÓ¦ÓóÌÐòÆô¶¯Ê±ÔËÐеĴúÂë
}
void Application_End(object sender, EventArgs e)
{
// ÔÚÓ¦ÓóÌÐò¹Ø±ÕʱÔËÐеĴúÂë
}
void Application_Error(object sender, EventArgs e)
{
// ÔÚ³öÏÖδ´¦ÀíµÄ´íÎóʱÔËÐеĴúÂë
Exception erroy = Server.GetLastError();
string err = "³ö´íÒ³ÃæÊÇ£º" + Request.Url.ToString() + "</br>";
......
1£ºGridView Ìí¼ÓÊôÐÔ£¨ÊÇ·ñɾ³ý£¬Êó±ê¾¹ý±³¾°£©
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699f0'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton l = (LinkButton)e.Row.FindControl("LinkButton1");
......
·Ï»°²»Ëµ£¬Ö±½Ó´úÂ벿·Ö´úÂëÕª³×ÔÍøÉÏ£¬ÔÚ´ËÏëÔ×÷Õß±íʾ¸Ðл
1¡¢·þÎñ¶Ë uploadFile.ashx
<%@ WebHandler Language="VB" Class="UploadFile" %>
Imports System
Imports System.Web
Imports System.Web.HttpServerUtility
Imports System.IO
Imports System.Web.HttpRequest
Public Class UploadFile : Implements IHttpHandler
Private m_UploadPath As String = "~\Files\"
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = "text/plain"
Dim responses As String = ""
Dim files As HttpFileCollection = context.Request.Files
If files.Count = 0 Then
'Response.Write("ÇëÎðÖ±½Ó·ÃÎʱ¾Îļþ ......
·Ï»°²»Ëµ£¬Ö±½Ó´úÂ벿·Ö´úÂëÕª³×ÔÍøÉÏ£¬ÔÚ´ËÏëÔ×÷Õß±íʾ¸Ðл
1¡¢·þÎñ¶Ë uploadFile.ashx
<%@ WebHandler Language="VB" Class="UploadFile" %>
Imports System
Imports System.Web
Imports System.Web.HttpServerUtility
Imports System.IO
Imports System.Web.HttpRequest
Public Class UploadFile : Implements IHttpHandler
Private m_UploadPath As String = "~\Files\"
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
context.Response.ContentType = "text/plain"
Dim responses As String = ""
Dim files As HttpFileCollection = context.Request.Files
If files.Count = 0 Then
'Response.Write("ÇëÎðÖ±½Ó·ÃÎʱ¾Îļþ ......
<%@ 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" >
<head runat="server">
<title>ÎÞ±êÌâÒ³</title>
<script type="text/javascript" src="script/jquery-1.2.6.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#Button1").bind("click",{btn:$("#Button1")},function(evdata){
$.ajax({
type:"POST",
& ......
1. ͼƬÎÊÌâ
·Ç³£ºÃ½â¾ö
<img runat="server" src="~/images/ad468x60.gif" alt="" />
¼ÓÉÏrunat="server" £¬Â·¾¶Ê¹Óþø¶Ô·¾¶~/»ù±¾ÉϾÍOKÁË¡£
2. CSSÎļþÒýÓÃ
<link rel="stylesheet" type="text/css" href="style.css" />
ÕâÀïÉñÆæµÄ¾ÍÊÇlinkµÄÎļþµÄhrefÊÇËæ×ű»·ÃÎÊÎļþµÄĿ¼½á¹¹×Ô¶¯µ÷Õû£¬Ëµ°×Á˾Ϳ¼ÂÇĸ°æÒ³ÒýÓõÄ·¾¶¾Í¿ÉÒÔÁË£¬ÆäËû²»Ó÷ÑÐÄ¡£
±ÈÈçÔÚĸ°æÒ³Í¬Ä¿Â¼ÏµÄÒ»¸öÎļþ¼ÐÄÚµÄÒ»¸öxxx.aspxÒýÓõÄĸ°æÒ³£¬ÄÇôÉÏÃæµÄÓï¾äÔÚ¿Í»§¶Ë¾Í×Ô¶¯±äΪ
<link rel="stylesheet" type="text/css" href="../style.css" />
ǰÌá¾ÍÊÇ<head runat="server"></head>±ØÐëÓÐrunat="server"
3. JSÎļþµÄÒýÓÃ
<script type="text/javascript" src="menu/jquery.min.js"></script>
ÕâÑùµÄ»°ÔÚÆäËûĿ¼ÏµÄÒ³ÃæÎļþ£¬¿Í»§¶Ë¿Ï¶¨¾ÍÒýÓò»µ½ÁË
ÄÇôÄãÐèÒªÕâÑù´¦Àí
<script type="text/javascript" src='<%=ResolveUrl("menu/jquery.min.js")%>'></script>
<script type="text/javascript" src='<%=ResolveClientUrl("menu/ddsmoothmenu.js")%>'></script>
ÕâÊÇ2ÖÖ·½Ê½£¬ÔÚ¿Í» ......
ÒòΪ¹«Ë¾µÄ²úÆ·ÓÃ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://localho ......