ASP.netÒ³ÃæÌøת·½Ê½±È½Ï
1 response.redirect Õâ¸öÌøתҳÃæµÄ·½·¨ÌøתµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø£¨2´Îpostback£©£¬µ«Ëû¿ÉÒÔÌøתµ½ÈκÎÒ³Ã棬ûÓÐÕ¾µãÒ³ÃæÏÞÖÆ£¨¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË£©£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ£¡redirectÌøת»úÖÆ£ºÊ×ÏÈÊÇ·¢ËÍÒ»¸ö httpÇëÇ󵽿ͻ§¶Ë£¬Í¨ÖªÐèÒªÌøתµ½ÐÂÒ³Ã棬Ȼºó¿Í»§¶ËÔÚ·¢ËÍÌøתÇëÇóµ½·þÎñÆ÷¶Ë¡£ÐèҪעÒâµÄÊÇÌøתºóÄÚ²¿¿Õ¼ä±£´æµÄËùÓÐÊý¾ÝÐÅÏ¢½«»á¶ªÊ§£¬ËùÒÔÐèÒªÓõ½session¡£
2 server.transfer Ëٶȿ죬ֻÐèÒªÒ»´Îpostback ,µ«ÊÇ¡£¡£¡£¡£Ëû±ØÐëÊÇÔÚͬһ¸öÕ¾µãÏ£¬ÒòΪËüÊÇserverµÄÒ»¸ö·½·¨¡£ÁíÍ⣬ËûÄÜÌø¹ýµÇ¼±£»¤¡£Äã¿ÉÒÔд¸öС³ÌÐòÊÔÊÔ£ºÉè¼ÆÒ»¸öÓÉÒ³ÃæÒ»µ½Ò³Ãæ¶þµÄÌøת£¬µ«Òª½øÈëµ½Ò³Ãæ¶þÐèÒªµÇ¼£¬formÈÏÖ¤£¬µ«Èç¹ûÌøתÓï¾äʹÓÃtransferµÄ»°£¬ÄǾͲ»»áµ¯³öµÇ¼ҳÃæÁË¡£Õâ¸ö·½·¨µÄÖض¨ÏòÇëÇóÊÇ·¢ÉúÔÚ·þÎñÆ÷¶Ë£¬ËùÒÔä¯ÀÀÆ÷µÄurlµØÖ·ÈÔÈ»±£ÁôµÄÊÇÔÒ³ÃæµÄµØÖ·£¡
3 sever.execute Õâ¸ö·½·¨Ö÷ÒªÊÇÓÃÔÚÒ³ÃæÉè¼ÆÉÏÃ棬¶øÇÒËû±ØÐëÊÇÌøתͬһվµãϵÄÒ³Ãæ¡£Õâ¸ö·½·¨ÊÇÐèÒª½«Ò»¸öÒ³ÃæµÄÊä³ö½á¹û²åÈëµ½ÁíÒ»¸öaspxÒ³ÃæµÄʱºòʹÓ㬴󲿷ÖÊÇÔÚ±í¸ñÖУ¬½«Ä³Ò»¸öÒ³ÃæÀàËÆÓÚǶÌ׵ķ½Ê½´æÔÚÓÚÁíÒ»Ò³Ãæ¡£
×ܽ᣺
µ±ÐèÒª°ÑÓû§Ìøתµ½Áíһ̨·þÎñÆ÷ÉϵÄÒ³ÃæµÄʱºò ʹÓÃredirect
µ±ÐèÒª°ÑÓû§Ìøתµ½·ÇaspxÒ³Ãæʱºò£¬Èçhtml ʹÓÃredirect
ÐèÒª°Ñ²éѯ×Ö·û´®×÷ΪurlÒ»²¿·ÖµÄʱºò±£Áô´«¸ø·þÎñÆ÷µÄʱºò£¬ÒòΪÆäËû2ÖÖ·½·¨²»ÄÜ×öµ½2´Îpostback£¬°ÑÊý¾ÝÏÈ´ø»Ø·þÎñÆ÷ ʹÓÃredirect
ÐèÒªaspxÒ³Ãæ¼äµÄת»»£¨²»Éæ¼°µÇ¼£© ʹÓÃtransfer
µ±ÐèÒª°ÑaspxÒ³ÃæµÄÊä³ö½á¹û²åÈëµ½ÁíÒ»¸öaspxÒ³ÃæµÄʱºòʹÓà execute·½·¨¡£
µ±È»£¬Íü¼ÇÁË»¹ÓÐÒ»¸ö³¬Á´½Ó£¡µ±È»Õâ¸ö¾Í²»ÐèÒª½²Ì«¶àÁË¡£ËûÊÇÔÚµ³ÐèÒªÓû§À´¾ö¶¨Ê²Ã´Ê±ºòÌøתҳÃ棬¾ÍʹÓó¬Á´½Ó¡£
˳±ãÌáһϣ¬ÈçºÎʹÓÃredirect·½·¨ÔÚ²éѯ×Ö·û´®ÖÐʹÓúº×Ö£¬ÒòΪ¾³£µÄÇé¿öÊdzöÏÖÂÒÂ룬ÔÒòÊÇurl²»Ö§³Öºº×Ö¡£Õâ¸öʱºòÐèҪת»»£º
string message =server.urlencode("»¶ÓÀ´µ½ÈüÅÜרÀ¸");
ÏÈת»»£¬ÔÚʹÓòéѯ×Ö·û´®
response.redirect("webform2.aspx?msg="+message);
asp.netʵÏÖ´ÓÒ»¸öÒ³ÃæÌøתµ½ÁíÒ»Ò³Ãæ·½·¨µÄ±È½Ï
ʵÏÖÒ³ÃæÌøתµÄ·½·¨ºÜ¶à£¬³ýÁË·þÎñÆ÷¿Ø¼þÊÇasp.net·â×°¹ýÍ⣬ÆäËüÔÚaspÖÐÒ²¾ÍÓÐÁË¡£
Õâô¶àʵÏÖ·½·¨ÖУ¬¶¼ÊÇʵÏÖͬÑùµÄ¹¦ÄÜ£¬ÎªÊ²Ã´»¹ÒªÖ§³ÖÈç´Ë¶àµÄ·½·¨ÄØ£¬ÎÒÃÇʵ¼ÊÓ¦ÓÃ
Öе½µ×Ó¦¸ÃÑ¡ÔñÄÄÒ»ÖÖ·½·¨ÄØ£¿Ò²ÐíÎÒÃÇ´ó¶àÊýÈ˶¼ÊÇÐèÒªÓÃÌøתʱ£¬Ëæ±ãÏëµ½Ò»¸ö±ãÄÃÀ´Óã¬
´Ó²»È¥¿¼ÂÇËüÃ
Ïà¹ØÎĵµ£º
Ê×ÏÈÉêÃ÷ ´¿Êô¸öÈËÁ·Ï°Ö®×÷ ÇëÎðÓÃÓÚÉÌҵĿµÄ..........ÎÞÓï
¼ÍÄîÒ»ÏÂÎÒÒÔÇ°µÄÒ»¸ö×÷Æ·<¿ú>,ÒÔºó¾ÍÓÃËüµ±ÎÒµÄLOGOÁË
½ñÌìÊÇÊ×·¢,ÕâƪÎÄÕÂÎÒ»á³ÖÐø¸üÐÂ,ÎÒ²ÎÕÕÁËÔ°ÇøÀïÇ°±²µÄ¾Ñé,ÃþË÷×ÅȥʵÏÖ,Ä¿Ç°´óÌåµÄ»¹Î´ÍêÉÆ,ÏÈ·¢ÕÅͼÉÏÀ´...
......
/// <summary>
/// ¹ýÂ˱ê¼Ç
/// </summary>
/// <param name="NoHTML">°üÀ¨HTML£¬½Å±¾£¬Êý¾Ý¿â¹Ø¼ü×Ö£¬ÌØÊâ×Ö·ûµÄÔ´Âë </param>
/// <returns>ÒѾȥ³ý±ê¼ÇºóµÄÎÄ×Ö</returns>
&nbs ......
×ܽáasp.net¿ª·¢³£Óõķ½·¨Ò»
using System;
using System.Globalization;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.IO;
namespace MoneyWise
{
/// <summary>
/// utils µÄժҪ˵Ã÷¡£
/// </summary>
public class utils
{
pr ......
asp.net ¿ª·¢Öг£ÓõÄһЩ·½·¨×ܽáËäȻдµÄ²»ºÃ,µ«ºÜʵÓÃ
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Net;
using System.Text.RegularExpressions;
using System.Web.UI;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using Syst ......
asp.net¿ª·¢ÖУ¬Í¨³£ÐèÒª×öһЩ¿Í»§¶ËÑéÖ¤¡£µ±ÎÒÃÇĬÈÏÔÚÒ»¸öÒ³ÃæÖмӸöbutton¿Ø¼þʱ£¬Õâ¸öButton±»asp.net Êä³öΪһ¸öSubmit°´Å¥¡£ asp:Button ID=Button1 runat=server Text=Button on click=Button1_Click /
ÔÚ_doPostBack·½·¨ÄÚ£¬Í¨¹ýtheForm.submit()À´Ê¹Êý¾ÝÌá½»µ½·þÎñÆ÷¡£
ÕâÑùºÜÈÝÒ׿´³ö£¬Èç ¹ûÎÒÃÇÏëÒªÔÚÊý¾ÝÌá½ ......