ת£ºÔÚASP.NETÖÐÔÚ²»Í¬Ò³Ãæ¼ä½øÐÐÊý¾Ý´«µÝÓÐÄÄЩ·½·¨
Ëѵģ¬ÍøÂçºÜÇ¿´óµÄ
1. Get(¼´Ê¹ÓÃQueryStringÏÔʽ´«µÝ)
·½Ê½£ºÔÚurlºóÃæ¸ú²ÎÊý¡£
ÌØµã£º¼òµ¥¡¢·½±ã¡£
ȱµã£º×Ö·û´®³¤¶È×Ϊ255¸ö×Ö·û£»Êý¾Ýй©ÔÚurlÖС£
ÊÊÓÃÊý¾Ý£º¼òµ¥¡¢ÉÙÁ¿¡¢¹Ø¼üµÄÊý¾Ý¡£
ÊÊÓ÷¶Î§£º´«µÝ¸ø×Ô¼º¡¢´«µÝ¸øÁíÒ»¸öÄ¿±êÒ³Ãæ£»³£ÓÃÓÚ2¸öÒ³Ãæ¼ä´«µÝÊý¾Ý¡£
Ó÷¨£ºÀýÈ磺urlºó¼Ó?UserID=…£¬Ìø×ªµ½Ä¿±êÒ³Ãæ£¬Ä¿±êÒ³ÃæÔÚËÅ·þ¶Ë¿ÉÓÃRequest.QueryString["InputText"]»ñÈ¡ÆäÖ¸¶¨²ÎÊýÖµ¡£
2. Post
·½Ê½£ºÍ¨Óõķ½Ê½¡£ÀûÓÃformÌá½»¡£
ÌØµã£º×î³£Óõķ½·¨¡£³£Óü¼ÇÉÊǰÑÒþÃØµÄÊý¾Ý´æÔÚÒþ²ØÓòÖÐÓÉformÌá½»¡£
ÊÊÓÃÊý¾Ý£º´óÁ¿Êý¾Ý£¬°üÀ¨ÎļþÉÏ´«¡£
ÊÊÓ÷¶Î§£ºÍ¬Get·½·¨
Ó÷¨£ºÔÚ¿Í»§¶ËformÖ¸¶¨actionÄ¿±êºósubmit¡¢ÔÚasp.netµÄËÅ·þ¶ËÖÐʹÓÃserver.Transfer(url)Ìá½»£»ÔÚËÅ·þ¶ËÖÐÓÃRequest.Form["FormFieldID"]»ñÈ¡¡£
3. Ò³Ãæ¶ÔÏóµÄÊôÐÔ
·½Ê½£ºasp.netÌØÓз½Ê½ ¡£ÀûÓÃHttpContext»ñÈ¡·¢ÇëÇóµÄÒ³ÃæµÄÐÅÏ¢¡£
ÌØµã£º¿ÉÒÔÖ±½Ó´æ´¢¶ÔÏó¡£
ȱµã£º×¢ÒâÇ¿ÖÆ×ª»»µÄÀàÐÍÒªÕýÈ·¡£
ÊÊÓÃÊý¾Ý£º¸÷ÖÖÊý¾Ý¡£
ÊÊÓ÷¶Î§£ºÒ³ÃæÖ®¼ä´«µÝ¸´ÔÓÊý¾Ý¡£
Ó÷¨£º»ñÈ¡Context.Handler½«Æäת»»Îª·¢ÇëÇóµÄÒ³ÃæµÄʵÀý£¬Ëæºó¾Í¿ÉÒÔÇáËÉ·ÃÎÊÆäformÖеÄ×ֶΡ¢ÉõÖÁÊôÐÔ¡£ÆäÖеÄContextÊÇÖ¸HttpContext¶ÔÏó£¬HandlerÊÇÆäÊôÐÔ£¬Context.HandlerµÄÒâ˼¿ÉÒÔÀí½âΪ´´½¨Ô´Ò³ÀàµÄʵÀý±äÁ¿£¬¶øµÃµ½´ËʵÀýÖ®ºó£¬¾Í¿ÉÒÔÖ±½Ó·ÃÎÊÆäÖеÄÊôÐÔºÍPublic·½·¨ÁË¡£
4. cookie
·½Ê½£º½«Êý¾Ý´æÔÚ¿Í»§¶ËµÄ¾µä·½·¨¡£
ȱµã£º°²È«ÐԵ͡¢Êܿͻ§¶ËÉèÖÃÏÞÖÆ¡¢Ò»¸öÕ¾µã½ö´æ20¸öcookie£¬Ã¿¸öÈÝÁ¿4096×Ö½Ú¡£
ÓÐЧÆÚ£º×Ô¶¨Òå»ò±»Óû§Çå³ý
ÊÊÓÃÊý¾Ý£ºÓû§µÄ»á»°Êý¾Ý(Ò»°ãÊÇÓû§Ãû£¬Óû§µÄ¸öÐÔ»¯ÉèÖÃÐÅÏ¢µÈ)
ÊÊÓ÷¶Î§£ºµ¥¸öÓû§¡¢Õû¸öÕ¾µãËùÓÐÒ³Ãæ
Ó÷¨£ºÒýÓÃRequest
Ïà¹ØÎĵµ£º
Ç°ÃæÎÒÃÇ˵¹ýÁË ¿ØÖÆÆ÷(controller) ºÍ·½·¨(action)
±¾´ÎҪ˵µÄ¾ÍÊÇ ViewÒÔ¼°ºÍ¿ØÖÆÆ÷(controller)¡¢·½·¨(action)Ö®¼äµÄ¹ØÏµ£»
´ó¼Ò¶¼ÖªµÀ MVCÖÐµÄ V ¾ÍÊÇView µÄÒâ˼£¬¾ÍÊÇ ³ÊÏÖ¸øÓû§µÄ½çÃæ£¬ÒÔÍùµÄasp.netÏîÄ¿ÖнРwebform£¬ÒÔǰ×öasp.netµÄʱºò¾ÍÊÇÔÚ¹¤¾ßÏäÀïÃæÍϿؼþ³öÀ´£¬
È»ºó¼òµ¥µÄÅŰæÒ»Ï¾ÍokÁË£¬´ó¶àÊýÓõķþ ......
·½·¨1
HttpFileCollection files = HttpContext.Current.Request.Files;
//ÎÒÉèÖõĴóС²»³¬¹ýA4Ö½µÄËõÂÔͼ
int newWidth=620;
int newHeight=880;
System.Drawing.Image img = null;
for(int iFile = 0; iFile < files.C ......
WebÒ³ÃæÊÇÎÞ״̬µÄ£¬ ·þÎñÆ÷¶Ôÿһ´ÎÇëÇó¶¼ÈÏΪÀ´×Ô²»Í¬Óû§£¬Òò´Ë£¬±äÁ¿µÄ״̬ÔÚÁ¬Ðø¶ÔÍ¬Ò»Ò³ÃæµÄ¶à´ÎÇëÇóÖ®¼ä»òÔÚÒ³ÃæÌø×ªÊ±²»»á±»±£Áô¡£ÔÚÓÃASP.NET Éè¼Æ¿ª·¢Ò»¸öWebϵͳʱ£¬ Óöµ½Ò»¸öÖØÒªµÄÎÊÌâÊÇÈçºÎ±£Ö¤Êý¾ÝÔÚÒ³Ãæ¼ä½øÐÐÕýÈ·¡¢°²È«ºÍ¸ßЧµØ´«ËÍ£¬Asp.net ÌṩÁË״̬¹ÜÀíµÈ¶àÖÖ¼¼ÊõÀ´½â¾ö±£´æºÍ´« ......
ASP.Net ѧϰ֮·µ»ØÉÏÒ»Ò³µÄʵÏÖ·½·¨
[ÈÕÆÚ£º01-20] [×ÖÌ壺´ó ÖРС]
·µ»ØÉÏÒ»Ò³µÄÕâ¸ö¶«¶«ÔÚÎÒÃÇ×öÏîÄ¿µÄʱºòÒ»°ãÊÇÓÃÓÚÌîдÍê±íµ¥ºóÈ·ÈϵÄʱºò£¬ÓжÔÔÀ´ÊäÈëµÄÊý¾Ý½øÐÐÐÞ¸ÄʱÓõ쬻òÕßÊÇÒòÎªÍøÕ¾ÎªÁË·½±ãä¯ÀÀÕß¶øÓÐÐÄÌí¼ÓµÄÒ»¸ö¶«¶«£¬Ò»°ãÕâÖÖ¹¦ÄܵÄʵÏÖÔÚASP.netÖж¼ÊÇÓÃÒ»¸öbuttonµÄ¿Ø¼þÀ´ÊµÏֵģ¬ÊµÏֵķ ......
Ò³Ãæµ¼³öExcelʱ£¬³£ÓõÄÖ±½ÓRenderControlµÄ·½·¨£¬Èç¹û±í¸ñÖÐÓÐÊý×Ö£¬ÔÚExcelÖÐÍùÍù¸ñʽ»áÂÒ£¬±ÈÈçÇ°ÃæÓÐ0£¬µ«ÏÔʾ³öÀ´ºó0¶¼±»È¥µôÁË¡£
Òò´ËÒªÔÚ°ó¶¨Êý×ÖµÄʱºò£¬ÊÖ¶¯Ö¸¶¨Ò»Ï´ËÁеĸñʽ£¬ÈÃÊý×ÖÒÔÎı¾·½Ê½ÏÔʾ¾ÍÐÐÁË
protected void myGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
......