ASP.NETÒ³ÃæÌøתµÄ¼¸ÖÖ·½·¨(תÔØ)
<a>±êÇ©
1. <a href=”test.aspx”></a>
2. ÕâÊÇ×î³£¼ûµÄÒ»ÖÖתÏò·½·¨;
HyperLink¿Ø¼þ
1. Asp.net ·þÎñÆ÷¶Ë¿Ø¼þ ÊôÐÔNavigateUrlÖ¸¶¨ÒªÌøתµ½µÄUrlµØÖ·
2. NavigateUrlÊÇ¿ÉÒÔÔÚ·þÎñÆ÷¶ËʹÓôúÂëÐ޸ģ¬Õâ¸öÇø±ðÓÚ<a>
3. ÓÉÓÚHyperLink±¾ÉíûÓÐʼþËùÒÔÒªÔÚ·þÎñÆ÷¶ËÆäËüʼþÖÐÉèÖÃNavigateUrl
4. ´úÂëʾÀý
<Asp:HyperLink id=”hyperlink” runat=”server” NavigatoeUrl=”test.aspx”>ok</Asp:HyperLink>
Response.Redirect()·½·¨
1. ¹ý³Ì£º·¢ËÍÒ»¸öHttpÏìÓ¦µ½¿Í»§¶Ë£¬Í¨Öª¿Í»§¶ËÌøתµ½Ò»¸öеÄÒ³Ã棬Ȼºó¿Í»§¶ËÔÙ·¢ËÍÌøתÇëÇóµ½·þÎñÆ÷¶Ë¡£
2. Ò³ÃæÌøת֮ºóÄÚ²¿¿Ø¼þ±£´æµÄËùÓÐÐÅÏ¢¶ªÊ§£¬µ±AÌøתµ½B£¬BÒ³Ã潫²»ÄÜ·ÃÎÊAÒ³ÃæÌá½»µÄÊý¾ÝÐÅÏ¢¡£
3. ʹÓÃÕâ¸ö·½·¨Ê¹ÓÃÕâ¸ö·½·¨Ìøתºóä¯ÀÀÆ÷µØÖ·À¸µÄUrlÐÅÏ¢¸Ä±ä
4. ¿ÉÒÔʹÓÃSession Cookies ApplicationµÈ¶ÔÏó½øÐÐÒ³Ãæ¼äµÄÊý¾Ý´«µÝ
5. Öض¨Ïò²Ù×÷·¢ÉúÔÚ¿Í»§¶Ë£¬×ܹ²Éæ¼°µ½Á½´ÎÓëWeb·þÎñÆ÷µÄͨÐÅ£ºÒ»´ÎÊǶÔÔʼҳÃæµÄÇëÇó£¬ÁíÒ»´ÎÊÇÖض¨ÏòÐÂÒ³ÃæµÄÇëÇó
Server.Transfer()·½·¨
1. ʵÏÖÒ³ÃæÌøתµÄͬʱ½«Ò³ÃæµÄ¿ØÖÆȨ½øÐÐÒƽ»
2. Ò³ÃæÌøת¹ý³ÌÖÐRequest SessionµÈ±£´æµÄÐÅÏ¢²»±ä£¬Ìøת֮ºó¿ÉÒÔʹÓÃÉÏÒ»¸öÒ³ÃæÌá½»µÄÊý¾Ý
3. Ìøת֮ºóä¯ÀÀÆ÷µØÖ·À¸µÄUrl²»±ä
4. ÕâÖÖ·½·¨µÄÖض¨ÏòÇëÇóÊÇÔÚ·þÎñÆ÷¶ËµÄ½øÐеģ¬ä¯ÀÀÆ÷²»ÖªµÀÒ³ÃæÒѾ·¢ÉúÁËÒ»´ÎÌøת
Server.Execute()·½·¨
1. ¸Ã·½·¨ÔÊÐíµ±Ç°
Ïà¹ØÎĵµ£º
ÔÚasp.netÀïÃ棬ºÜ¶àʱºòʹÓÃsessionÀ´±£´æһЩ¶ÔÏ󣬱ÈÈç˵¹ºÎï³µµÈµÈ£¬Óкܶàʱºò£¬¾ÍËãÄãÉèÖÃÁËsession³¬Ê±µÄʱ¼ä£¬session»¹ÊÇ»áÎÞÔµÎ޹ʵĶªÊ§£¬ÕâÀïÓÐÒ»ÖֱȽϼòµ¥µÄ·½·¨¿ÉÒÔÉèÖÃsession¶ªÊ§µÄʱ¼ä¡£
ÔÚweb.configÀïÃæÈçÏÂÅäÖÃ
<sessionState
& ......
ÔÚweb¿ª·¢ÖÐ,¾³£ÒªÓõ½¿Ø¼þµÄOnClientClickÓëOnClickʼþ.
Èç¹ûʹÓò»µ±,¾³£»áÓöµ½Ò»Ð©ÒâÁÏÖ®ÍâµÄÊÂÇé·¢Éú,ÈÃÈËÃþ²»×ÅÍ·ÄÔ.ÏÂÃæ¾Í½«ÎÒµÄһЩСС×ܽáµÀÀ´:
Ê×ÏÈÎÒÃÇÒªÁ˽âÕâÁ½¸öʼþ:
OnClientClickÊÇ¿Í»§¶Ëʼþ·½·¨.Ò»°ã²ÉÓÃJavaScriptÀ´½øÐд¦Àí.Ò²¾ÍÊÇÖ±½ÓÔÚIE¶ËÔËÐÐ.Ò»µã»÷¾ÍÔËÐÐ.
OnClickʼþÊÇ·þÎñÆ÷¶Ëʼþ´¦Àí ......
ASP.NET(C#)·µ»ØÉÏÒ»Ò³(ºóÍË)´úÂë
2008-08-10 10:32
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ViewState["BackUrl"] = Request.UrlReferrer.ToString();
}
}
/// <s ......
×ܽá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¿ª·¢ÖУ¬Í¨³£ÐèÒª×öһЩ¿Í»§¶ËÑéÖ¤¡£µ±ÎÒÃÇĬÈÏÔÚÒ»¸öÒ³ÃæÖмӸöbutton¿Ø¼þʱ£¬Õâ¸öButton±»asp.net Êä³öΪһ¸öSubmit°´Å¥¡£ asp:Button ID=Button1 runat=server Text=Button on click=Button1_Click /
ÔÚ_doPostBack·½·¨ÄÚ£¬Í¨¹ýtheForm.submit()À´Ê¹Êý¾ÝÌá½»µ½·þÎñÆ÷¡£
ÕâÑùºÜÈÝÒ׿´³ö£¬Èç ¹ûÎÒÃÇÏëÒªÔÚÊý¾ÝÌá½ ......