ASP.NETÖÐÒ³Ãæ´«Öµ £¨´«Í³·½·¨£©
Ò»¡¢Ä¿Ç°ÔÚASP.NETÖÐÒ³Ãæ´«Öµ¹²ÓÐÕâô¼¸ÖÖ·½Ê½£º
1¡¢±íµ¥Ìá½»£¬
<form action= "target.aspx" method = "post" name = "form1">
<input name = "param1" value = "1111"/>
<input name = "param2" value = "2222"/>
</form>
....
form1.submit();
....
´ËÖÖ·½ÔÚASP¡£NETÖÐÎÞЧ£¬ÒòΪASP¡£NETµÄ±íµ¥×ÜÊÇÌá½»µ½×ÔÉíÒ³Ã棬Èç¹ûÒªÌá½»µ½±ðÒ»Ò³Ã棬ÐèÒªÌØÊâ´¦Àí¡£
2¡¢<A href="target.aspx?param1=1111¶m2=2222">Á´½ÓµØÖ·´«ËÍ</A>
½ÓÊÕÒ³Ã棺 string str = Request["param1"]
3¡¢Session¹²Ïí
·¢ËÍÒ³Ã棺Session("param1") = "1111";
°´ÊÕÒ³Ãæ string str = Session("param1").ToString();
4¡¢Application¹²Ïí
·¢ËÍÒ³Ã棺 Application("param1") = "1111";
°´ÊÕÒ³Ã棺 string str = Application("param1").ToString();
´ËÖÖ·½·¨²»³£Ê¹Óã¬ÒòΪApplicationÔÚÒ»¸öÓ¦ÓóÌÐòÓò·¶Î§¹²Ïí£¬ËùÓÐÓû§¿ÉÒԸı估ÉèÖÃÆäÖµ£¬¹ÊÖ»Ó¦ÓüÆÊýÆ÷µÈÐèҪȫ¾Ö±äÁ¿µÄµØ·½¡£
5¡¢Cookie
6¡¢Response.Redirect()·½Ê½
Response.Redirect("target.aspx?param1=1111¶m2=2222")
½ÓÊÕÒ³Ã棺 string str = Request["param1"]
7¡¢Server.Transfer()·½Ê½¡£
Server.Transfer("target.aspx?param1=1111¶m2=2222")
½ÓÊÕÒ³Ã棺 string str = Request["param1"]
¶þ¡¢Èç¹ûÔÚÁ½¸öÒ³Ãæ¼äÐèÒª´óÁ¿µÄ²ÎÊýÒª´«´«µÝ£¬ÈçÊý¾Ý²éѯµÈÒ³Ãæʱ£¬ÓÃ1 £ 6µÄ·½·¨´«Öµ¼°Æä²»±ã£¬¶øµÚ 7 ÖÖ·½·¨È·ÓÐÒ»¶ÀÌصÄÓÅÊÆ£¡µ«Ê¹Óø÷½·¨Ê±ÐèÒªÒ»¶¨µÄÉèÖã¬ÏÖ¼òµ¥½éÉÜһϸ÷½·¨µÄʹÓ÷½Ê½£º
¡¡¡¡ÒÔ²éѯÊý¾ÝÒ³ÃæΪÀý£º
ÔÚ²éѯҳÃæÖÐÉèÖÃÈçϹ«ÓÐÊôÐÔ(QueryPage.aspx)£º
public class QueryPage : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox txtStaDate;
protected System.Web.UI.WebControls.TextBox txtEndDate;
...
/// <summary>
/// ¿ªÊ¼Ê±¼ä
/// </summary>
public string StaDate
{
get{ return this.txtStaDate.Text;}
set{this.txtStaDate.Text = value;}
}
/// <summary>
/// ½áÊøʱ¼ä
/// </summary>
publi
Ïà¹ØÎĵµ£º
×î½üÔÚasp.net Óõ½µÄsqlserver´æ´¢¹ý³Ì·ÖÒ³ÖÐÏÔʾÊý¾ÝʱÓöµ½¹ØÓÚÅÅÐòÎÊÌâ¡£
ÍøÉϵÄһЩ·ÖÒ³´æ´¢¹ý³ÌÖ»Ö§³ÖÅÅÐòÁÐΪint ÀàÐÍ£¬¶ÔÓÚʵ¼Ê¿ª·¢Öкܶàʱºò¶¼ÐèÒª¶ÔDateTimeÀàÐÍ£¬varcharÀàÐͽøÐÐÅÅÐò¡£
ÏÂÃæ·ÖÏíһϿÉÒÔÖ§³ÖÈÎÒâÊý¾ÝÀàÐ͵ÄÁнøÐÐÅÅÐòµÄ´æ´¢¹ý³Ì¡£
Create PROCEDURE sp_viewByPage
@TblName var ......
1.¶ÔIEä¯ÀÀÆ÷½øÐÐÉèÖÃ
Îļþ-¡µÒ³ÃæÉèÖÃ-¡µ½«ÀïÃæµÄҳüºÍÒ³½ÅµÄÄÚÈÝÇå¿Õ ¾ÍOKÁË
2.Ò³Ãæ´úÂëʵÏÖ Javascript
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><!-- & ......
PRB£ºÔÚʹÓà Response.End¡¢Response.Redirect »ò Server.Transfer ʱ³öÏÖ ThreadAbortException
Ö¢×´
Èç¹ûʹÓà Response.End¡¢Response.Redirect »ò Server.Transfer ·½·¨£¬½«³öÏÖ ThreadAbortException Òì³£¡£Äú¿ÉÒÔʹÓà try-catch Óï¾ä²¶»ñ´ËÒì³£¡£
ÔÒò
Response.End ·½·¨ÖÕÖ¹Ò³µÄÖ´ÐУ¬²¢½«´ËÖ´ÐÐÇл»µ½Ó¦ÓóÌÐò ......
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()À´Ê¹Êý¾ÝÌá½»µ½·þÎñÆ÷¡£
ÕâÑùºÜÈÝÒ׿´³ö£¬Èç ¹ûÎÒÃÇÏëÒªÔÚÊý¾ÝÌá½ ......