Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NETÒ³ÃæÖض¨Ïò·½·¨Ð¡½á

Òý×Ô: http://renhappy20066.blog.163.com/blog/static/112080786200961172521923/
ASP.NETÒ³ÃæÖض¨Ïò·½·¨Ð¡½á
asp.net   2009-07-11 07:25   ÔĶÁ54   ÆÀÂÛ0  
×ֺţº ´ó´ó  ÖÐÖР СС
Ò³ÃæÖض¨ÏòµÄʹÓúܶ࣬ʵÏÖ·½·¨Ò²Óв»Í¬£¬×Ô¼ºÒ²ÊÔ¹ý¼¸ÖÖ£¬ÏÖÔÚ×ܽáһϡ£
    Ò»¡¢Transfer Execute RedirectÖض¨Ïò·½·¨½éÉÜ
     1.Server.Transfer·½·¨:
     Server.Transfer("m2.aspx");//Ò³ÃæתÏò(·þÎñÆ÷ÉÏÖ´ÐÐ)¡£·þÎñÆ÷Í£Ö¹½âÎö±¾Ò³,±£´æ´ËҳתÏòÇ°µÄÊý¾Ýºó,ÔÙʹҳÃæתÏòµ½m2.aspx, ²¢½«×ªÏòÇ°Êý¾Ý¼ÓÉÏm2.aspxÒ³½á¹û·µ»Ø¸øä¯ÀÀÆ÷¡£
     2.Server.Execute·½·¨:
     Server.Execute("m2.aspx"); ·þÎñÆ÷±£´æ´ËҳתÏòÇ°µÄÊý¾Ýºó,ʹҳÃæתÏòµ½m2.aspxÖ´ÐÐ, ÔÙ·µ»Ø±¾Ò³¼ÌÐøÖ´ÐÐ.ÔÙ½«ÈýÕß½á¹ûºÏ²¢ºó·µ»Ø¸øä¯ÀÀÆ÷.
     ÒÔÉ϶¼ÊÇ·þÎñÆ÷¶ËÒ³ÃæתÏòËùÒÔä¯ÀÀÆ÷²»³öÏÖÒ³¸ü¸Ä¼Ç¼(ÏÔʾµÄµØÖ·²»»á¸Ä±ä)¡£Òò´Ë,Èç¹ûÓû§Ë¢Ð´ËÒ³,Ò²Ðí»á³öÏÖһЩÆäËüÒâÍâÇé¿ö. ´ËÀàҳתÏò,¿ÉÍê³ÉһЩÆäËü¹¦ÄÜ,±ÈÈç·ÃÎʵ½Ç°Ò»Ò³ÃæÖеķþÎñ¶Ë¿Ø¼þ¡£
     3.Response.Redirect:
     µ±ä¯ÀÀÆ÷ÇëÇóaspxÒ³Ãæʱ,Åöµ½Redirect(url)·½·¨, Ï൱ÓÚ¸æËßä¯ÀÀÆ÷,ÄãÏÈÐè·ÃÎÊijҳÃæ,ÓÚÊÇä¯ÀÀÆ÷ÔÙÏò·þÎñÆ÷·¢ËÍÒ»¸öµ½´ËÒ³ÃæµÄÇëÇó¡£Öض¨Î»ÊÇͨ¹ýä¯ÀÀÆ÷Ö´ÐеÄ,ÔÚ·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö®¼ä»á²úÉú¶îÍâµÄÍù·µ¹ý³Ì¡£ÔÚÍøÂç×´¿ö²»ÊǺܺõÄÇé¿öÏÂ,Á½´ÎÇëÇó»á´ó´óµÄ½µµÍÓ¦ÓóÌÐòµÄ·´Ó¦ËÙ¶È,ÉõÖÁÕ¼ÓöàÓàµÄ´ø¿í¡£
     ×ܽá, ÔÚÍøÂç״̬½ÏºÃµÄÇé¿öÏÂ,Redirect(url)·½·¨Ð§ÂÊ×î¸ß!! Server.Transfer·½·¨ºÍServer.Execute·½·¨×îÁé»î!! Server.Execute·½·¨Õ¼ÓÃ×ÊÔ´×î¶à¡£
    ¶þ¡¢ÌøתҳÃæasp.netÌṩµÄÈýÖÖ·½·¨±È½Ï
     1 response.redirect Õâ¸öÌøתҳÃæµÄ·½·¨ÌøתµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø£¨2´Îpostback£©£¬µ«Ëû¿ÉÒÔÌø תµ½ÈκÎÒ³Ã棬ûÓÐÕ¾µãÒ³ÃæÏÞÖÆ£¨¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË£©£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ£¡redirectÌøת»úÖÆ£ºÊ×ÏÈÊÇ·¢ËÍÒ»¸öhttpÇëÇ󵽿ͻ§¶Ë£¬Í¨ÖªÐèÒªÌøתµ½ÐÂÒ³Ã棬Ȼºó¿Í»§¶ËÔÚ·¢ËÍÌøתÇëÇóµ½·þÎñÆ÷¶Ë¡£ÐèҪעÒâµÄÊÇÌøתºóÄÚ²¿¿Õ¼ä±£´æµÄËùÓÐÊý¾ÝÐÅÏ¢½«»á¶ªÊ§£¬Ë


Ïà¹ØÎĵµ£º

asp.net template item Àï id ÔÚpostbackºó ²»Ò»ÖÂ

֮ǰÓöµ½Ò»¸öºÜÓôÃƵÄÎÊÌ⣬ ´ó¸Å¾ÍÊÇdagagridÀïÓ¦ÓÃÁËÒ»¸öÐÐÊÇcheckbox£¬ ½á¹ûËÀ»îµãcheck all£¬ submitÒÔºó Response.FormÀïµÄidºÍ FindControlÀïÕÒµ½µÄ²»Ò»ÖÂÁË.
½áÂÛÊÇ:
datagrid °ó¶¨ÒÔºóÔÙÒ²²»Òª¶¯ÁË! ·ñÔò ǰ̨id ÔÙpostback µÄʱºòÊDz»Ò»Ö嵀 ......

Asp.Net×÷ÓÃÓò

1.Application£ºÓÃÓÚ±£´æËùÓÐÓû§¹²ÓõÄÊý¾ÝÐÅÏ¢¡£ ÔÚAsp.NetÖÐÀàËƵÄÅäÖÃÊý¾Ý×îºÃ±£´æÔÚWeb.configÎļþÖС£Èç¹ûʹÓÃApplication¶ÔÏó£¬Ò»¸öÐèÒª¿¼ÂǵÄÎÊÌâÊÇÈκÎд²Ù×÷¶¼ÒªÔÚ Application_OnStartʼþ£¨global.asax£©ÖÐÍê³É¡£¾¡¹ÜʹÓÃApplication.LockºÍ Application.Unlock·½·¨À´±ÜÃâд²Ù×÷µÄͬ²½£¬µ«ÊÇËü´®Ðл¯ÁËApplicat ......

asp.netÉÏ´«Îļþ¸ñʽÏÞÖÆ

if(MyFile.PostedFile.ContentType   !=   "image/gif"    
  &&   MyFile.PostedFile.ContentType   !=   "image/jpg"    
  &&   MyFile.PostedFile.ContentType   !=   "image/pjpeg"    
  && &n ......

Asp.Netǰ̨µ÷Óúǫ́±äÁ¿

Asp.Netǰ̨µ÷Óúǫ́±äÁ¿
asp.net   2009-07-11 07:27   ÔĶÁ220   ÆÀÂÛ0  
×ֺţº ´ó´ó  ÖÐÖР СС
1.Asp.NetÖм¸ÖÖÏàËƵıê¼Ç·ûºÅ: < %=...%>< %#... %>< % %>< %@ %>½âÊͼ°Ó÷¨
´ð: < %#... %>: ÊÇÔڰ󶨿ؼþDataBind()·½·¨Ö´Ð ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ