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>ÎÞ±êÌâ
Ïà¹ØÎĵµ£º
»ñÈ¡Óйط¢³öÒ³ÇëÇóµÄÓû§µÄÐÅÏ¢¡£
Ò»¡¢HttpContext Àà
·â×°Óйظö±ð HTTP ÇëÇóµÄËùÓÐ HTTP Ìض¨µÄÐÅÏ¢¡£
HttpContext ÀàÐ͹«¿ªÒÔϳÉÔ±¡£
¹¹Ô캯Êý
Ãû³Æ
˵Ã÷
HttpContext
ÒÑÖØÔØ¡£ ³õʼ»¯ LinePragmaCodeInfo ÀàµÄÒ»¸öÐÂʵÀý¡£
·½·¨
Ãû³Æ
˵Ã÷
AddError
½«Òì³£Ìí¼Óµ½µ±Ç° HTTP ÇëÇóµÄÒ ......
ÊÓͼ״̬ÊÇ ASP.NET Ò³¿ò¼ÜÓÃÓÚÔÚÍù·µ¹ý³ÌÖ®¼ä±£ÁôÒ³ºÍ¿Ø¼þÖµµÄ·½·¨¡£ÔÚ³ÊÏÖÒ³µÄ HTML ±ê¼Çʱ£¬±ØÐëÔڻط¢¹ý³ÌÖб£ÁôµÄÒ³ºÍÖµµÄµ±Ç°×´Ì¬½«±»ÐòÁл¯Îª Base64 ±àÂë×Ö·û´®¡£È»ºó£¬´ËÐÅÏ¢½«±»·ÅÈëÒ»¸ö»ò¶à¸öÊÓͼ״̬Òþ²Ø×ֶΡ£
1¡¢·½°¸
ÊÓͼ״̬ÓÉ ASP.NET Ò³¿ò¼Ü×Ô¶¯ÓÃÓÚ±£´æÔÚ¸ ......
¶ÔÓÚasp.net,ĬÈÏÖ»ÔÊÐíÉÏ´«2MÎļþ,Ôö¼ÓÈçÏÂÅäÖÃ,Ò»°ã¿ÉÒÔ×Ô¶¨Òå×î´óÎļþ´óС.
<httpRuntime executionTimeout="300" maxRequestLength="40960" useFullyQualifiedRedirectUrl="false"/>
ÎÒÃÇÔÚÉÏ´«´óÎļþʱ¶¼Óöµ½¹ýÕâÑù»òÄÇÑùµÄÎÊÌâ¡£ÉèÖúܴóµÄmaxRequestLengthÖµ²¢²»ÄÜÍê ......
Default.aspx CSÎļþ´úÂë
using System;
using System.Data;
using System.Configuration;
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;
public partial class _De ......