eval()·½·¨ÔÚÔËÐÐʱʹÓ÷´ÉäÖ´ÐкóÆÚ°ó¶¨¼ÆË㣬Òò´ËÓë±ê×¼µÄASP.NETÊý¾Ý°ó¶¨·½·¨bindÏà±È£¬»áµ¼ÖÂÐÔÄÜÃ÷ÏÔϽµ¡£ËüÒ»°ãÓÃÔÚ°ó¶¨Ê±ÐèÒª¸ñʽ»¯×Ö·û´®µÄÇé¿öÏ¡£¶àÊýÇé¿ö¾¡Á¿ÉÙÓô˷½·¨
Eval ·½·¨ÊǾ²Ì¬£¨Ö»¶Á£©·½·¨£¬¸Ã·½·¨²ÉÓÃÊý¾Ý×ֶεÄÖµ×÷Ϊ²ÎÊý²¢½«Æä×÷Ϊ×Ö·û´®·µ»Ø¡£Bind ·½·¨Ö§³Ö¶Á/д¹¦ÄÜ£¬¿ÉÒÔ¼ìË÷Êý¾Ý°ó¶¨¿Ø¼þµÄÖµ²¢½«Èκθü¸ÄÌá½»»ØÊý¾Ý¿â¡£
ʹÓà Eval ·½·¨
Eval ·½·¨¿É¼ÆËãÊý¾Ý°ó¶¨¿Ø¼þ£¨Èç GridView¡¢DetailsView ºÍ FormView ¿Ø¼þ£©µÄÄ£°åÖеĺóÆÚ°ó¶¨Êý¾Ý±í´ïʽ¡£ÔÚÔËÐÐʱ£¬Eval ·½·¨µ÷Óà DataBinder ¶ÔÏóµÄ Eval ·½·¨£¬Í¬Ê±ÒýÓÃÃüÃûÈÝÆ÷µÄµ±Ç°Êý¾ÝÏî¡£ÃüÃûÈÝÆ÷ͨ³£Êǰüº¬ÍêÕû¼Ç¼µÄÊý¾Ý°ó¶¨¿Ø¼þµÄ×îС×é³É²¿·Ö£¬Èç GridView ¿Ø¼þÖеÄÒ»ÐС£Òò´Ë£¬Ö»ÄܶÔÊý¾Ý°ó¶¨¿Ø¼þµÄÄ£°åÄڵİó¶¨Ê¹Óà Eval ·½·¨¡£
Eval ·½·¨ÒÔÊý¾Ý×ֶεÄÃû³Æ×÷Ϊ²ÎÊý£¬´ÓÊý¾ÝÔ´µÄµ±Ç°¼Ç¼·µ»ØÒ»¸ö°üº¬¸Ã×Ö¶ÎÖµµÄ×Ö·û´®¡£¿ÉÒÔÌṩµÚ¶þ¸ö²ÎÊýÀ´Ö¸¶¨·µ»Ø×Ö·û´®µÄ¸ñʽ£¬¸Ã²ÎÊýΪ¿ÉÑ¡²ÎÊý¡£×Ö·û´®¸ñʽ²ÎÊýʹÓÃΪ String ÀàµÄ Format ·½·¨¶¨ÒåµÄÓï·¨¡£
ʹÓà Bind ·½·¨
Bind ·½·¨Óë Eval ·½·¨ÓÐһЩÏàËÆÖ®´¦£¬µ«Ò²´æÔںܴóµÄ²îÒì¡£ËäÈ»¿ÉÒÔÏñʹÓà Eval ·½·¨Ò»ÑùʹÓà Bind ·½·¨À´¼ìË÷Êý¾Ý° ......
Ò»£¬»ñµÃMircosoft URLRewriter.dll£º
»ñµÃMircosoft URLRewriter.dll¿ÉÒÔµ½http://www.microsoft.com/china/msdn/library/webservices/asp.net/URLRewriting.mspx?mfr=true
ÏÂÔØÍê±Ïºó£¬µ¼È빤³Ì£¬ÎÒÕâÀïûÓжԸù¤³Ì×öÈκÎÐ޸쬱£ÁôÁËÔÀ´µÄÖØÐ´·½Ê½£¬È»ºóÖ±½ÓÔÚVS2005ÀïÃæÉú³É.dllÎļþ¾Í¿ÉÒÔÁË¡£
¶þ£¬Ê¹ÓøÃdllÎļþ£º
Ìí¼ÓÒýÓ㬸㶨¡£
Èý£¬Ò³Ãæ·½ÃæµÄÉè¼Æ£¬ÕâÀï²»ÔÚ׸ÊöÁË£¬ÎÒ»á·ÅÒ»¸öÏÂÔØ°ü£¬ÓÐÐËȤµÄÅóÓÑÏÂÔØÀ´¿´¿´°É£¬´úÂëдµÄ±È½ÏÂÒ¡£
ËÄ£¬web.configµÄÅäÖÃ
ÕⲿÊǷdz£¹Ø¼üµÄ£¬Ò²ÊǾ²Ì¬»¯ÄÜ·ñ³É¹¦µÄ¹Ø¼ü¡£
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
  ......
//µÚÒ»ÖÖ·½Ê½
Response.Cookie("CookieÃû³Æ").value="Öµ" //дÈë
username=Request.Cookies("CookieÃû³Æ").value// ¶ÁÈ¡
//µÚ¶þÖÖ·½Ê½
HttpCookie hcCookic = new HttpCookie("CookieÃû³Æ","Öµ");
Response.Cookies.Add(hcCookic);
C# :
//·½·¨1:
Response.Cookies["username"].Value="gjy";
Response.Cookies["username"].Expires=DateTime.Now.AddDays(1);
//·½·¨2:
System.Web.HttpCookie newcookie=new HttpCookie("username");
newcookie.Value="gjy";
newcookie.Expires=DateTime.Now.AddDays(1);
Response.AppendCookie(newcookie);
//´´½¨´øÓÐ×Ó¼üµÄcookies:
System.Web.HttpCookie newcookie=new HttpCookie("user");
newcookie.Values["us ......
×Ô¶¨Òå¿Ø¼þÖеÄÒ³Ãæ´úÂ룺
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wcontrol.ascx.cs" Inherits="wcontrol" %>
<script type ="text/javascript">
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
this.oBtnTodayTitle="Today"
this.oBtnCancelTitle="Cancel"
this.weekDaySting=new Array("S","M","T","W","T","F","S");
this.monthSting=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
this.Width=200;
this.currDate=new Date();
this.today=new Date();
this.startYear=1970;
this.endYear=3010;
///Css
this.divBorderCss="1px solid #BCD0DE";
this.tableBorderColor="#CCCCCC"
///Method
this.Init=CalendarInit;
this.Fill=CalendarFill;
this.Refresh=CalendarRefresh;
this.Restore=CalendarRestore;
///HTMLObject
this.oTaget=null;
this.oPreviousCell=null;
this.sDIVID=InstanceName+"oDiv";
this.sTABLEID=InstanceName+"oTable" ......
×Ô¶¨Òå¿Ø¼þÖеÄÒ³Ãæ´úÂ룺
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wcontrol.ascx.cs" Inherits="wcontrol" %>
<script type ="text/javascript">
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
this.oBtnTodayTitle="Today"
this.oBtnCancelTitle="Cancel"
this.weekDaySting=new Array("S","M","T","W","T","F","S");
this.monthSting=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
this.Width=200;
this.currDate=new Date();
this.today=new Date();
this.startYear=1970;
this.endYear=3010;
///Css
this.divBorderCss="1px solid #BCD0DE";
this.tableBorderColor="#CCCCCC"
///Method
this.Init=CalendarInit;
this.Fill=CalendarFill;
this.Refresh=CalendarRefresh;
this.Restore=CalendarRestore;
///HTMLObject
this.oTaget=null;
this.oPreviousCell=null;
this.sDIVID=InstanceName+"oDiv";
this.sTABLEID=InstanceName+"oTable" ......
ÐèÒªÓõ½µÚÈý·½¿Ø¼þICSharpCode.SharpZipLib.dll
using System.IO;
using System.IO.Compression;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Checksums;
#region ѹËõÎļþ¼Ð,Ö§³ÖµÝ¹é
/// <summary>
///¡¡Ñ¹ËõÎļþ¼Ð
/// </summary>
/// <param name="dir">´ýѹËõµÄÎļþ¼Ð</param>
/// <param name="targetFileName">ѹËõºóÎļþ·¾¶£¨°üÀ¨ÎļþÃû£©</param>
/// <param name="recursive">ÊÇ·ñµÝ¹éѹËõ</param>
/// <returns></returns>
public bool Compress(string dir, string targetFileName, bool recursive)
{
&nbs ......
µÚÒ»ÖÖ·½·¨£º
ͨ¹ýURLÁ´½ÓµØÖ·´«µÝ
send.aspx:
protected void Button1_Click(object sender, EventArgs e)
{
Request.Redirect("Default2.aspx?username=honge");
}
receive.aspx:
string username = Request.QueryString["username"]; // ÕâÑù¿ÉÒԵõ½²ÎÊýÖµ¡£
µÚ¶þÖÖ·½·¨£º
ͨ¹ýpost·½Ê½¡£
send.aspx
<form id="form1" runat="server" action="receive.aspx" method=post>
<div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:TextBox ID="username" runat="server"></asp:TextBox>
</div>
</form>
receive.aspx
string username = Ruquest.Form["receive"];&n ......