ÔÚASP.NETÖÐʹÓÃTreeview¿Ø¼þºÍXML
ÔÚASP.NETÖÐʹÓÃTreeview¿Ø¼þºÍXML
ÒÔÇ°£¬ÔÚWEBÒ³ÃæÖÐÈç¹ûÏëʹÓÃÊ÷ÐοؼþµÄ»°£¬ÍùÍù»áÓÐЩÂé·³£¬ÓÐʱÉõÖÁÒª×Ô¼ºÐ´´úÂëÀ´´ïµ½ÓÃÊ÷ÐÎÁбíÏÔʾÊý¾ÝµÄÄ¿µÄ¡£ÔÚasp.netÖУ¬ÎÒÃÇ¿ÉÒԺܷ½±ãµØʹÓÃÓÉ΢ÈíÌṩµÄInternet Exploer Web Controls¿Ø¼þÀ´ÊµÏÖÊ÷ÐÎÁÐ±í¡£ÔÚ΢ÈíÌṩµÄÕâÌ×Internet Exploere Web Controls¿Ø¼þ¼¯ºÏÖУ¬°üÀ¨ÓÐMultiPage£¬TabStrip£¬TOOLbar£¬Treeview¿Ø¼þ¡£ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÃÇÀ´¿´ÔÚASP.netÖÐÈçºÎʹÓÃTreeview¿Ø¼þºÍXMLÀ´ÊµÏÖÊ÷ÐÎÁÐ±í¡£
¡¡¡¡Î¢ÈíµÄÕâÌ׿ؼþ¿ÉÒÔÔÚhttp://asp.net/IEWebControls/Download.aspx?tabindex=0&tabid=1
ÖÐÏÂÔØ£¬ÏÂÔغóÔËÐÐsetup°²×°¾Í¿ÉÒÔÁË¡£ÏÖÔÚÎÒÃÇÀ´ÊÔÏÂÓÃTreeview¿Ø¼þ×ö¸ö¼òµ¥µÄÀý×Ó¡£
¡¡¡¡ÔÚvs.netÖÐн¨Ò»¸öWEB¹¤³Ì£¬Ö®ºóÔÚ¹¤¾ßÏäÖУ¬Êó±êÓÒ¼üµ¯³öµÄ²Ëµ¥ÖУ¬Ñ¡Ôñ“Ìí¼ÓÐÂÏ¬ÔÚ×Ô¶¨Ò幤¾ßÏäÖУ¬Ñ¡ÔñTREEVIEW¿Ø¼þ£¨×¢ÒâÑ¡ÔñµÄÊÇÃüÃû¿Õ¼äΪMicrosoft Internet Exploere web controlµÄÃüÃû¿Õ¼ä£©£¬°´È·¶¨ºó£¬¾Í¿ÉÒÔÔÚ¹¤¾ßÏäÖгöÏÖTreeview¿Ø¼þÁË¡£
¡¡¡¡½Ó×Å£¬½«treeview¿Ø¼þÍÏÀµ½´°ÌåÖУ¬Çл»µ½HTMLÊÓͼ£¬Õâʱ»á·¢ÏÖÓÐÈçÏ´úÂ룺
<%@ Register TagPrefix="ie"
Namespace="Microsoft.Web.UI.WebControls"
Assembly="Microsoft.Web.UI.WebControls" %>
¡¡¡¡µ±È»£¬Äã¿ÉÒԸıäTagPrefixµÄ±ê¼ÇÖµ£¬±ÈÈ磬¸ÄΪFooBar£¬ÄÇôÒÔºóÔÚÒýÓÃTreeview¿Ø¼þʱ£¬¾ÍÓÃÈçÏ·½Ê½ÒýÓãº
<FooBar:TreeView runat="server" ... />
¡¡¡¡ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔͨ¹ýµãÑ¡Treeview¿Ø¼þµÄÊôÐÔ¿òÖеÄnodesÊôÐÔ£¬À´Îª¸ÃÊ÷Ìí¼Ó¸÷Àà½áµãÁË£¬ÓÉÓڱȽϼòµ¥£¬ÕâÀï²»Ïêϸ½²Êö¡£ÏÂÃæÊÇÌí¼ÓÍê¸÷Àà½áµãºóµÄ´úÂ룺
<form runat="server">
¡¡<ie:TreeView runat="server">
¡¡¡¡<ie:TreeNode Text="Isaac Gibson" Expanded="True">
¡¡¡¡¡¡<ie:TreeNode Text="Birth - 1766" />
¡¡¡¡¡¡<ie:TreeNode Text="Death - 1827" />
¡¡¡¡¡¡<ie:TreeNode Text="Spouse">
¡¡¡¡¡¡<ie:TreeNode Text="Ritty Gibson" />
¡¡¡¡¡¡<ie:TreeNode Text="Married 1789" />
¡¡¡¡¡¡<ie:TreeNode Text="Children">
¡¡¡¡¡¡<ie:TreeNode Text="Phoebe Gibson">
¡¡¡¡¡¡<ie:TreeNode Text="Birt
Ïà¹ØÎĵµ£º
1.ASP.NETÔËÐÐÔÀí¸ÅÊö
¡¡¡¡ÈçÉÏͼ£¬µ±Ò»¸öhttpÇëÇó·¢Ë͹ýÀ´²¢±»IIS»úÊÕµ½Ö®ºó,IISÊ×ÏÈͨ¹ýÄãÇëÇóµÄÒ³ÃæÀàÐÍΪÆä¼ÓÔØÏàÓ¦µÄdllÎļþ£¬È»ºóÔÚ´¦Àí¹ý³ÌÖн«ÕâÌõÇëÇó·¢Ë͸øÄܹ»´¦ÀíÕâÌõÇëÇóµÄÄ£¿é,¶øÔÚASP.NETÖÐÕâ¸öÄ£¿é¾Í½Ð×öHttpHandler,ΪʲôaspxÕâÑùµÄÎļþ¿ÉÒÔ±»·þÎñÆ÷´¦Àí,ÄÇÊÇÒòΪÔÚ·þÎñÆ÷¶ËÓÐĬÈϵÄHttpHandlerרÃÅ´ ......
´ò¿ªÒ»¸öÍøÒ³£¬ÉÏÃæÏÔʾ5ÃëÖÓÒÔºóÌøתµ½ÆäËûÍøÒ³£¬Ã¿¹ýÒ»Ã룬Ëü¾Í»á¸Ä±ä£¨4ÃëÖÓÒÔºóÌøת£¬3ÃëÖÓÒÔºóÌøת¡£¡£¡££©
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head&g ......
package com.accp.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.H ......
×òÌìÓöµ½ÁËÒ»¸öСÎÊÌâ,Ìá½»±íµ¥µÄʱºò,ºǫ́µÄactionÖÐÑéÖ¤µÄ±íµ¥ÀïµÄ¿Ø¼þÖµ¾ÓÈ»ÊÇ¿ÕÖµ,µ÷À´µ÷È¥²»µÃÆä·¨.
ÎÒÔÚǰ̨µÄ±íµ¥Àï¿Ø¼þÓõÄÊDZê×¼html¿Ø¼þ
Ò³ÃæÉÏʹÓÃÏÂÃæÓï¾ä·¢ËÍform
<%using (Html.BeginForm("AddNewPicGroups", "MetaData")){ %>
ºǫ́ʹÓÃÈçÏÂÓï¾ä½ÓÊÕʱȴ½ÓÊÕ²»µ½Êý¾Ý
public ActionResult AddNew ......
protected void Page_Load(object sender, EventArgs e)
...{
this.btnOK.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(btnOK, "Click") + ";this.disabled=true; this.value='Ìá½»ÖÐ...';");
}
//°´Å¥´¦Àí·½·¨
protected void btnOK_C ......