ASP.NET¿çÒ³Ãæ´«Öµ¼¼ÇÉ×ܽá
¹ØÓÚÒ³Ãæ´«ÖµµÄ·½·¨£¬Òý·¢Á˺ܶàÌÖÂÛ¡£1. ʹÓÃQueryString±äÁ¿¡£2. ʹÓÃApplication ¶ÔÏó±äÁ¿¡£4. ʹÓÃCookie¶ÔÏó±äÁ¿¡£Õâ¸ö²Å¿ÉÒÔ˵ÊÇÃæÏó¶ÔÏ󿪷¢ËùʹÓõķ½·¨£¬ÆäʹÓÃServer.Transfer·½·¨°ÑÁ÷³Ì´Óµ±Ç°Ò³ÃæÒýµ¼¡£
¡¡¡¡1. ʹÓÃQueryString±äÁ¿
¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
¡¡¡¡a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
string s_url;
s_url = "b.aspx?name=" + Label1.Text;
Response.Redirect(s_url);
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
Label2.Text = Request.QueryString["name"];
}
¡¡¡¡2. ʹÓÃApplication ¶ÔÏó±äÁ¿
¡¡¡¡Application¶ÔÏóµÄ×÷Ó÷¶Î§ÊÇÕû¸öÈ«¾Ö£¬Ò²¾ÍÊÇ˵¶ÔËùÓÐÓû§¶¼ÓÐЧ¡£Æä³£Óõķ½·¨ÓÃLockºÍUnLock¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Application["name"] = Label1.Text;
Server.Transfer("b.aspx");
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
Application.Lock();
name = Application["name"].ToString();
Application.UnLock();
}
¡¡¡¡3. ʹÓÃSession±äÁ¿
¡¡¡¡Ïë±ØÕâ¸ö¿Ï¶¨ÊÇ´ó¼ÒʹÓÃÖÐ×î³£¼ûµÄÓ÷¨ÁË£¬Æä²Ù×÷ÓëApplicationÀàËÆ£¬×÷ÓÃÓÚÓû§¸öÈË£¬ËùÒÔ£¬¹ýÁ¿µÄ´æ´¢»áµ¼Ö·þÎñÆ÷ÄÚ´æ×ÊÔ´µÄºÄ¾¡¡£
a.aspxµÄC#´úÂë
private void Button1_Click(object sender, System.EventArgs e)
{
Session["name"] = Label.Text;
}
b.aspxÖÐC#´úÂë
private void Page_Load(object sender, EventArgs e)
{
string name;
name = Session["name"].ToString();
}
¡¡¡¡4. ʹÓÃCookie¶ÔÏó±äÁ¿
¡¡¡¡Õâ¸öÒ²ÊÇ´ó¼Ò³£Ê¹Óõķ½·¨£¬ÓëSessionÒ»Ñù£¬ÆäÊÇʲ¶Ôÿһ¸öÓû§¶øÑԵģ¬µ«ÊÇÓиö±¾ÖʵÄÇø±ð£¬¼´CookieÊÇ´æ·ÅÔÚ¿Í»§¶ËµÄ£¬¶
Ïà¹ØÎĵµ£º
JSON Serialization and Deserialization in ASP.Net
I was looking around for a simple example which would just do an object serialization to a JSON format, and then deserializing back to the original object. I found few examples on MSDN, but did seem to be too long ......
¸Õѧϰ.NetûÓж೤ʱ¼ä£¬ÒÔÇ°¶¼ÊÇ¿´±ðÈ˵ÄÎÄÕ£¬Ñ§Ï°Ç°±²ÃǵľÑéºÍ¼¼ÇÉ£¬×Ô¼ºÊÜÒæ·Ëdz¡£½ñÌìÒ²À´¸öÔ´´µÄ£¬·¢¸öÎļþÉÏ´«µÄ´úÂë¡£Ö÷ҪʵÏֵŦÄÜÓУº1.¿ÉÒÔ¿ØÖÆÔÊÐíÉÏ´«µÄÎļþÀàÐÍ£»2.ÉÏ´«Ö®ºó×Ô¶¯ÒÔʱ¼äÃüÃû£»3.×Ô¶¯´´½¨ÉÏ´«ÎļþÒª±£´æµÄĿ¼¡£
²»×ãÖ®´¦£ºÃ»ÓжÔÔÊÐíÉÏ´«µÄÎļþ´óС×öÏÞÖÆ¡£ÆäËû²»×ãÖ®´¦»¹Íû¸÷λָ³ö£¬ÒÔ ......
using (con)
{
con.Open();
String sqltext = "select * from emp where empno=@empno";
......
ASP.NETÒ³Ãæˢз½·¨×ܽá
ÏÈ¿´¿´ASP.NETÒ³ÃæˢеÄʵÏÖ·½·¨£º
µÚÒ»£º
private void Button1_Click(objectsender,System.EventArgse)
{
Response.Redirect(Request.Url.ToString());
}
µÚ¶þ£º
private void Button2_Click(objectsender,System.EventArgse)
{
Response.Write("<mce:script language=javascript& ......
Abs(number) È¡µÃÊýÖµµÄ¾ø¶ÔÖµ¡£
Asc(String) È¡µÃ×Ö·û´®±í´ïʽµÄµÚÒ»¸ö×Ö·ûASCII Âë¡£
Atn(number) È¡µÃÒ»¸ö½Ç¶ÈµÄ·´ÕýÇÐÖµ¡£
CallByName (object, procname, usecalltype,[args()]) Ö´ÐÐÒ»¸ö¶ÔÏóµÄ·½·¨¡¢É趨»ò´«»Ø¶ÔÏóµÄÊôÐÔ¡£
CBool(expression) ת»»±í´ïʽΪBoolean ÐÍ̬¡£
CByte(expression) ת»»±í´ïʽΠ......