Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NET AJAXµ÷ÓÃWebService

ÈçºÎÔÚ¿Í»§¶ËÖ±½Óµ÷ÓÃWebServiceÖеķ½·¨£¿
ÕâÀï½áºÏ¾­Ñé×Ô¼ºÐ´Ò»Ð´
1.Ê×ÏÈн¨Ò»¸ö ASP.NET AJAX-Enabled Web Site,ÕâÑùϵͳΪÎÒÃÇ×Ô¶¯ÅäÖúÃÁË»·¾³£¬ÕâÖ÷ÒªÌåÏÖÔÚWeb.configÕâ¸öÎļþÉÏ£¬Èç¹ûÒÑÓÐÍøÕ¾²»ÊÇASP.NET AJAX-Enabled Web SiteÒ²¿ÉÒÔ¶ÔÕÕÐÞ¸ÄÏÂWeb.config£¬Ò²¿ÉÒÔ´ïµ½ÏàͬµÄЧ¹û¡£
2.н¨Ò»¸öweb·þÎñ£¬WebService.asmx£¬ÔÚWebService.csÐèÒªÌí¼ÓSystem.Web.Script.Services;Õâ¸öÃüÃû¿Õ¼ä£º
using System.Web.Script.Services;
È»ºó¸øWebService ÀàÌí¼Ó[ScriptService]ÊôÐÔÕâÀïÏÈ˵²½Ö裬ºóÃæ˵ԭÀí£¬È»ºó¸øÎÒÃÇÐèÒªµ÷Óõķ½·¨¼ÓÉÏ
[WebMethod]ÊôÐÔ
3.н¨Ò»¸öJScriptÎļþ£¬JScript.js£¬ÀïÃæÓÃÀ´ÏìÓ¦½çÃæʼþ´¦Àí»Øµ÷·½·¨·µ»ØµÄÊý¾Ý
4.н¨Ò»¸öÒ³ÃæDefault.aspx,Èç¹ûÊÇASP.NET AJAX-Enabled Web SiteÒ³ÃæÉÏ»á×Ô¶¯Ìí¼ÓScriptManager¿Ø¼þ£¬Èç¹û²»ÊÇÖ»ÒªÊÖ¹¤ÍÏÉÏÈ¥Ò»¸ö£¬È»ºó¸øScriptManagerÌí¼ÓScript½Úµã£¬Õâ¸ö½ÚµãÓÃÀ´Ö¸¶¨ÒªÊ¹ÓõÄjsÎļþ
<Scripts><asp:ScriptReference Path="~/JScript.js" /></Scripts>
ÔÙ¸øScriptManagerÌí¼ÓServices½Úµã£¬Õâ¸ö½ÚµãÓÃÀ´Ö¸¶¨ÒªÊ¹ÓõÄWebService
<Services><asp:ServiceReference Path="~/WebService.asmx" /></Services>
ÕâЩ¹¤×÷Íê³ÉºóÖ»ÒªÔÚ½çÃæÉÏij¸ö¿Ø¼þ»òÕßij¸öµØ·½µ÷ÓÃÎÒÃǵÄjs·½·¨¾Í¿ÉÒÔÁË¡£
˵µÄÊǵ÷Óñ¾µØµÄWebService,Èç¹ûÊǵ÷ÓÃÍøÉϵÄWebService,Ô­ÀíÒ²ÊÇÒ»Ñù£¬²»¹ýÐèÒªÌí¼Óµã¶«Î÷£¬¾ÍÄÓһЩ³£ÓõÄWebServices”ÖеĵÚÒ»¸öWebServiceÀ´Ëµ°É£¬ÌìÆøÔ¤±¨Web·þÎñ£¬ÔÚÍøÕ¾ÉÏÌí¼ÓwebÒýÓã¬
ÔÚurlµØÖ·ÖÐÌîÈëµØÖ··þÎñµØÖ·£¬Ç°Íù£¬È»ºóÌí¼ÓÒýÓþͿÉÒÔÁË£¬ÆäËü´¦ÀíºÍ±¾µØÒ»Ñù¡£
ÌùһϴúÂ룬°üÀ¨±¾µØµÄweb·þÎñºÍÔ¶³Ìweb·þÎñ
I.Default.aspx´úÂ룺
<html xmlns="[color=#000000]http://www.w3.org/1999/xhtml[/color]">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" >
        <Scripts>
          


Ïà¹ØÎĵµ£º

ASP.NET URL Ó³Éä

ÔÚWeb.configÎļþµÄ <system.web></system.web>ÕâÁ½¸ö½ÚµãÖмä²åÈëÐèÒªÓ³ÉäµÄURL
 <urlMappings enabled="true">
      <add url="~/Óû§Òª·ÃÎʵÄÒ³Ãæ.aspx" mappedUrl="~/ÒªÖض¨Ïòµ½µÄÒ³Ãæ.aspx"/>
 </urlMappings> ......

asp.net·ÀÖ¹Öظ´Ìá½»Êý¾Ý

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 ......

ASP.NETµÄForm±íµ¥

Form ±íµ¥£ºÒ»¸öÒ³ÃæÖ»ÄÜÓÐÒ»¸ö
runat=“server”²»ÊDZØÐëµÄ£¬¼ÓÉϺ󣬻áÔÚÊä³öµÄÔ´´úÂëÀï¶àÁËÒ»ÐÐ
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGR/8ZxOm5Tn0sfHNJaqE12hKqqJTQ==" />
ºÙ£¬Õâ²»¾ÍÊÇ´«ËµÖеÄviewstateÂð¡£Ô­À´Õâ¾ÍÊÇ.netÖеÄFORM¸úHTMLÖÐF ......

asp.net browse for folder

System.Windows.Forms;
FolderBrowserDialog ÌṩÁËÎÒÃÇÐèÒªµÄÎļþ¼Ðä¯ÀÀ¶Ô»°¿ò£¬ÒòΪÊÇCOM±ØÐëÊÇSTAµÄ£¬ÉèÖà AspCompat="true"À´½â¾öÕâ¸öÎÊÌâ¡£
Ó÷¨£º
    protected void Button1_Click(object sender, EventArgs e)
    {
 
         ......

ÔÚASP.NETÖÐʹÓÃTreeview¿Ø¼þºÍXML


ÔÚASP.NETÖÐʹÓÃTreeview¿Ø¼þºÍXML
ÒÔÇ°£¬ÔÚWEBÒ³ÃæÖÐÈç¹ûÏëʹÓÃÊ÷ÐοؼþµÄ»°£¬ÍùÍù»áÓÐЩÂé·³£¬ÓÐʱÉõÖÁÒª×Ô¼ºÐ´´úÂëÀ´´ïµ½ÓÃÊ÷ÐÎÁбíÏÔʾÊý¾ÝµÄÄ¿µÄ¡£ÔÚasp.netÖУ¬ÎÒÃÇ¿ÉÒԺܷ½±ãµØʹÓÃÓÉ΢ÈíÌṩµÄInternet Exploer Web Controls¿Ø¼þÀ´ÊµÏÖÊ÷ÐÎÁÐ±í¡£ÔÚ΢ÈíÌṩµÄÕâÌ×Internet Exploere Web Controls¿Ø¼þ¼¯ºÏÖУ¬°üÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ