asp.net ¶¯Ì¬×ÝÏò²Ëµ¥
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.Common;
using System.Data.Common;
public partial class LeftMenu : System.Web.UI.Page
{
Database db = DatabaseFactory.CreateDatabase("sqlconstr2");
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
GVDataBind();
}
private void GVDataBind()
{
DbCommand dcmd = db.GetSqlStringCommand("select * from dbo.[Group] where UserID=0");
DataSet ds = db.ExecuteDataSet(dcmd);
this.GridView1.DataSource=ds.Tables[0];
this.GridView1.DataBind();
}
private void DLDataBind(DataList dl, int GID)
{
string sql = "SELECT [User].*,[GroupUser].GroupID from [GroupUser] INNER JOIN [User] ON [User].ID=[GroupUser].UserID WHERE GroupID=" + GID + "";
DbCommand dcmd = db.GetSqlStringCommand(sql);
DataSet ds = db.ExecuteDataSet(dcmd);
dl.DataSource = ds.Tables[0];
dl.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataList dlUser = (DataList)e.Row.FindControl("DataList1");
if (dlUser != null)
{ ///°ó¶¨Êý¾Ý
DLDataBind(dlUser, Int32.Parse(this.GridView1.DataKeys[e.Row.RowIndex].Value.ToString()));
}
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LeftMenu.aspx.cs" Inherits="LeftMenu" %>
<!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>ÎÞ±êÌâ
Ïà¹ØÎĵµ£º
ͨ³£²¿ÊôÍøÕ¾µÄʱºòÐèÒª±àÒëÄÇЩÐèÒªµÄÎļþ£¬ºÍһЩϵͳÐèÒªµÄ×é¼þ¡£
»á¸Ð¾õµ½ºÜ·±Ëö¡£
·¢²¼ÍøÕ¾ÊÇÒ»¸ö²»´íµÄÑ¡Ôñ:Ö±½Ó·¢²¼·þÎñÆ÷ÉÏ£¬ÉèÖúÃÕ¾µãÓë¶Ë¿Ú¼´¿É¡£ÒÔÏÂÊÇ×ܽáµÄ²½Öè¡£¡£¡£
µÚÒ»¡¢Êǽ«ÍøÕ¾ÀïËùÓеÄÊý¾ÝÁ¬½Ó¶¼×ö³É´Óweb.configÖжÁÈ¡£¬ÕâÑùµÄ»°£¬¾Í¿ÉÒÔÒ»ÀÍÓÀÒÝÁË¡£
µÚ¶þ¡¢¾ÍÊÇIISÉèÖÃÁË£¬ÔÚIISÖеÄasp.netÖÐ ......
»ñÈ¡Óйط¢³öÒ³ÇëÇóµÄÓû§µÄÐÅÏ¢¡£
Ò»¡¢HttpContext Àà
·â×°Óйظö±ð HTTP ÇëÇóµÄËùÓÐ HTTP Ìض¨µÄÐÅÏ¢¡£
HttpContext ÀàÐ͹«¿ªÒÔϳÉÔ±¡£
¹¹Ô캯Êý
Ãû³Æ
˵Ã÷
HttpContext
ÒÑÖØÔØ¡£ ³õʼ»¯ LinePragmaCodeInfo ÀàµÄÒ»¸öÐÂʵÀý¡£
·½·¨
Ãû³Æ
˵Ã÷
AddError
½«Òì³£Ìí¼Óµ½µ±Ç° HTTP ÇëÇóµÄÒ ......
¿´ÁËÄÇô¶à£¬»¹ÊÇÇ××Ô¶¯ÊÖʵ¼ùÏÂÓÐЧ¹û¡£
ÒýÓà °Ù¶È ÑîÔÆ·ÉaiÉú»î
ASP.NET 2.0 ʵÏÖα¾²Ì¬ÍøÒ³·½·¨
·½·¨Ò»£ºÀûÓÃHttphandlerʵÏÖURLÖØд£¨Î±URL¼°Î±¾²Ì¬£©
ÎÒÃÇÓÐʱºò»á¼ûµ½ÕâÑùµÄµØÖ·£º“http://www.huoho.com/show-12-34.html”£¬Äã»òÐíÈÏΪÔÚÕ¾µã·þÎñÆ÷¸ùĿ¼“/”Ï´æÔÚÃûΪ“show- ......
Èý²ã¼Ü¹¹(3-tier application) ͨ³£ÒâÒåÉϵÄÈý²ã¼Ü¹¹¾ÍÊǽ«Õû¸öÒµÎñÓ¦Óû®·ÖΪ£º±íÏֲ㣨UI£©¡¢ÒµÎñÂß¼²ã£¨BLL£©¡¢Êý¾Ý·ÃÎʲ㣨DAL£©¡£Çø·Ö²ã´ÎµÄÄ¿µÄ¼´ÎªÁË“¸ßÄÚ¾Û£¬µÍñîºÏ”µÄ˼Ïë¡£
1¡¢±íÏֲ㣨UI£©£ºÍ¨Ë×½²¾ÍÊÇÕ¹ÏÖ¸øÓû§µÄ½çÃ棬¼´Óû§ÔÚʹÓÃÒ»¸öϵͳµÄʱºòËûµÄËù¼ûËùµÃ¡£
2¡¢ÒµÎñ ......