ASP.NET Cookies¼òµ¥Ó¦Óà ¼ÇסÓû§ÃûºÍÃÜÂë
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace TLibrary.ObjectHelper
{
public class CookiesHelper
{
#region »ñÈ¡Cookie
/// <summary>
/// »ñµÃCookieµÄÖµ
/// </summary>
/// <param name="cookieName"></param>
/// <returns></returns>
public static string GetCookieValue(string cookieName)
{
return GetCookieValue(cookieName, null);
}
/// <summary>
/// »ñµÃCookieµÄÖµ
/// </summary>
/// <param name="cookieName"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string GetCookieValue(string cookieName,string key)
{
HttpRequest request = HttpContext.Current.Request;
&nbs
Ïà¹ØÎĵµ£º
ºÜ¶àAsp.netµÄ½Ì³ÌÖеÄʾÀý´úÂëʹÓõÄÊý¾Ý·ÃÎÊ·½·¨ÊÇLinq to Sql»òÊÇEntity Framework¡£ÎÒÔÚwww.asp.netµÄÂÛ̳ÉÏ¿´µ½ºÜ¶à¹ØÓÚÌÖÂÛÊÇ·ñÓÐÆäËûÌæ´úµÄÊý¾Ý¿â·ÃÎÊ·½Ê½£¬»Ø´ðÊÇ£ºµ±È»ÓС£ÕâƪÎÄÕ¾ͽ²ÊöÁËʹÓÃAdo.Net×÷ΪÊý¾Ý·ÃÎʲãÀ´ÊµÏÖÒ»¸öµäÐ͵ÄÔöɾ²é¸Ä³ÌÐò¡£
ÓÉÓÚÊÇÒÔÁ·Ï°×÷ΪĿµÄ ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("<script>window.open
('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"')</script>")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attributes.Add("o ......
1£ºÉÏ´«Í¼Æ¬µÄÏà¶Ô·¾¶µ½Êý¾Ý¿âÖÐÏàÓ¦×Ö¶ÎÀ¶ÁÈ¡ÏÔʾʱ£¬½«¿Ø¼þ£¨¼ÙÉèÓõÄÊÇImage¿Ø¼þ£©µÄImageUrlÊôÐÔÖ¸Ïò¸ÃÏà¶Ô·¾¶¼´¿É¡£
2£º½«Í¼Æ¬ÒÔ¶þ½øÖÆÁ÷µÄ·½Ê½ÕûÌåÉÏ´«µ½Êý¾Ý¿âÀ¶ÁÈ¡ÏÔʾʱ£¬ÒÔ¶þ½øÖÆÁ÷µÄ·½Ê½ÕûÌå¶Á³ö¡£ÕâÖÖ·½·¨ÉÔ΢Âé·³Ò»µã£¬µ«±£´æµÄÊÇͼƬÕûÌåµ½Êý¾Ý¿âÀï¡£
µÚÒ»ÖÖ·½·¨£¬ÊµÏÖÆðÀ´±È½Ï¼òµ¥£¬ÒòΪ´æÈëÊý¾Ý¿ ......
ÕâÁ½¸öÊý¾ÝÀàÐÍÊÇÎÒÃÇÔÚѧϰC#ÓïÑԵĹý³ÌÖÐÊý¾Ý±È½ÏÄѵÄÁ½¸öÊý¾ÝÀàÐÍ£¬²»¹ýËûÃǺÜÖØÒª£¬ËùÒÔÓбØÒªÄóöÀ´ËµËµËûÃǵÄʹÓ÷½·¨ºÍ²»Í¬Ö®´¦£¬Ï£Íû¶ÔÄãÓÐËù°ïÖú¡£
ÏÈ×ܵÄÀ´Ëµ£º
ͨ³£ÎÒÃÇÏò·½·¨Öд«µÝµÄÊÇÖµ.·½·¨»ñµÃµÄÊÇÕâЩֵµÄÒ»¸ö¿½±´,È»ºóʹÓÃÕâЩ¿½±´,µ±·½·¨ÔËÐÐÍê±Ïºó,ÕâЩ¿½±´½«±»¶ªÆú,¶øÔÀ´µÄÖµ²»½«Êܵ½Ó°Ïì.´ËÍâÎÒÃÇ ......
1. µ±ÔÚÒ»¸ö Action ÖÐ ¶ÔÏàͬ¹¦ÄܵÄ2¸ö¿Ø¼þ½øÐи³Öµ
List<SelectListItem> WebSite = GetWebSite();
ViewData["SiteNames"] = WebSite;
if (WebSite.Count > 0)
WebSite.RemoveAt(0);
ViewData["SiteName"] = WebSite;
Ò³ÃæÏÔʾʱ»áͳһÒÔ WebSite ......