Asp.netÔÚȨÏÞÇý¶¯Ï¶¯Ì¬Éú³É²Ëµ¥µÄÁ½ÖÖ·½·¨
ÕâЩÄÚÈݱȽϼòµ¥£¬µ«ÊDZȽÏÈÝÒ×Íü¼Ç¡£ÌØдÏÂÀ´°ïÖú¼ÇÒ䣺£¨ÕâÀïÓõÄÊÇTreeViewºÍXmlDataSource°ó¶¨µÄÀý×Ó£©
µÚÒ»ÖÖ£º¶ÔÊôÐÔµÄÖµÖ±½Ó½øÐа󶨡£
Ê×ÏÈ £ºÀÒ»¸öTreeViewµ½Ò³ÃæÉÏ£¬IDÃüÃûΪ"TrvLeft"¡£È»ºóÔÚºǫ́½øÐа󶨣¬
´úÂëÈçÏ£º
XmlDataSource XmlDb = new XmlDataSource();
XmlDb.DataFile = "Menu.xml";
trvLeft.DataSource = XmlDb;
TreeNodeBinding tnb = new TreeNodeBinding();
tnb.DataMember = "MenuItem";
tnb.TextField = "Text";
tnb.NavigateUrlField = "NavigateUrl";
tnb.ImageUrlField = "ImageUrl";
trvLeft.DataBindings.Add(tnb);
trvLeft.DataBind();
ÆäÖÐMenu.xmlµÄÄÚÈÝÈçÏ£º
<?xml version="1.0" encoding="utf-8" ?>
<MenuItem Text="Ö÷²Ëµ¥" NavigateUrl="Index.aspx" ImageUrl="main.gif">
<MenuItem Text="Ò»¼¶²Ëµ¥" NavigateUrl="#" ImageUrl="Images/1.gif">
<MenuItem Text="¶þ¼¶²Ëµ¥" NavigateUrl="#" ImageUrl="Images/1.gif"></MenuItem>
<MenuItem Text="¶þ¼¶²Ëµ¥" NavigateUrl="#" ImageUrl="Images/1.gif"></MenuItem>
</MenuItem>
</MenuItem>
<MenuItem Text="Ö÷²Ëµ¥" NavigateUrl="Index.aspx" ImageUrl="main.gif">
<MenuItem Text="Ò»¼¶²Ëµ¥" NavigateUrl="#" ImageUrl="Images/1.gif">
<MenuItem Text="¶þ¼¶²Ëµ¥" NavigateUrl="#" ImageUrl="Images/1.gif"></MenuItem>
<MenuItem Text="¶þ¼¶²Ëµ¥" NavigateUrl="#" ImageUrl="Images/1.gif"></MenuItem>
</MenuItem>
</MenuItem>
µÚ¶þÖÖ£ºµÝ¹éÊ÷²éѯ¸³Öµ£º
public void Bind()
Ïà¹ØÎĵµ£º
1 »ñÈ¡´íÎóÐÅÏ¢²¢µ½Ö¸¶¨Ò³Ã治ҪʹÓÃResponse.Redirect,¶øÓ¦¸ÃʹÓÃServer.Transfer
e.g
// in global.asax
protected void Application_Error(Object sender, EventArgs e) {
if (Server.GetLastError() is HttpUnhandledException)
Server.Transfer("MyErrorPage.aspx");
//ÆäÓàµÄ·ÇHttpUnhandledExceptio ......
using System.Text.RegularExpressions;
Regex reg = new Regex(@"^\d+$"); //ÑéÖ¤×Ö·û´®
Response.Write( reg.IsMatch(""));
Response.Write(reg.IsMatch("sf"));
Response.Write ......
ASP.NET»ñÈ¡ÌìÆøÔ¤±¨´óÖ·ÖÎöÓÐ 1µ½Ä³¸öÍøÕ¾ÉÏ·ÖÎöÍøÕ¾µÄ´úÂë»ñÈ¡£»2×Ô¼ºÐ´Çý¶¯·þÎñºÍweb·þÎñ µÚ¶þÖÖˮ̫Éî²»ÔøÉæ¼°¡£
ASP.NETºǫ́³ÌÐò»ñÈ¡ÖÐÑëÆøÏǫ́ÌìÆøÔ¤±¨
1.ÌìÆø·â×°³ÉÒ»¸öʵÌå
2.¿ÉÒÔ»ñÈ¡µ±ÌìÌìÆø£¬Ò²¿ÉÒÔ»ñȡδÀ´ÎåÌìµÄÌìÆø¼¯ºÏ
using System;
using System.Collections.Generic;
using System.Text;
......
Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇÇ°Á½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úÇ°Á½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
Request ¶ÔÏóµÄÊôÐԺͷ½·¨± ......
·ÖÀà: ר¼ÒBlog ÍƼöÕߣºadmin| ä¯ÀÀÁ¿£º489 views| 1 ¸öÆÀÂÛ
Èç¹ûÎÒÃÇÓÃIISËÞÖ÷ASP.net£¬µ¥²½µ÷ÊÔʱ£¬»áÓпÉÄÜÏÂÃæµÄÒì³£±¨³öÀ´£º
—————————
Microsoft Visual Studio
—————————
The web serv ......