Asp.Netǰ̨µ÷Óúǫ́±äÁ¿
1.Asp.NetÖм¸ÖÖÏàËƵıê¼Ç·ûºÅ: < %=...%>< %#... %>< % %>< %@ %>½âÊͼ°Ó÷¨
´ð: < %#... %>: ÊÇÔڰ󶨿ؼþDataBind()·½·¨Ö´ÐÐʱ±»Ö´ÐУ¬ÓÃÓÚÊý¾Ý°ó¶¨
Èç: < %# Container.DataItem("tit") %>
< %= %>: ÔÚ³ÌÐòÖ´ÐÐʱ±»µ÷Ó㬿ÉÒÔÏÔʾºǫ́±äÁ¿Öµ
Èç:
*.aspxÖУº < %= aaa %>
*.csÖÐ: protected string aaa="ÐÕÃû";
< % %>: ÄÚÁª´úÂë¿éÀïÃæ¿ÉÒÔÔÚÒ³ÃæÎļþ*.aspx»ò*.ascxÎļþÀïÃæǶÈëºǫ́´úÂë
Èç:
< %
for(int i=0;i<100;i++)
{
Reaponse.Write(i.ToString());
}
%>
< %@ %>ÊÇÔÚ*.aspxÒ³Ãæǰ̨´úÂëµ¼ÈëÃüÃû¿Õ¼ä,
Èç:
< %@ Import namespace="System.Data"%>
2.¿Ø¼þ½ÓÊÕÄÄЩÀàÐÍÊý¾Ý?
´ð:½ÓÊÕBindµÄ¿Ø¼þ£¬Ò»°ãÓÐDropDownList,DataList,DataGrid,ListBoxÕâЩ¼¯ºÏÐÔÖʵĿؼþ£¬¶ø±»À¦°ó µÄÖ÷ÒªÊÇArrayList(Êý×é),Hashtable(¹þÏ¡±í),DataView(Êý¾ÝÊÓͼ),DataReaderÕâËĸö£¬ÒÔºóÎÒÃǾͿÉÒÔ ¶ÔºÅÈë×ù£¬²»»á³öÏÖDataTable±»À¦°óµÄ´íÎóÁË£º£©
3.DataBind,»ñµÃµÄÊý¾Ý£¬ÏµÍ³»á½«ÆäĬÈÏΪString,ÔõÑùת»¯ÎªÆäËüµÄÀàÐÍ?
DataBinder.Eval(Container.DataItem,"ת»»µÄÀàÐÍ","¸ñʽ")
×îºóÒ»¸ö"¸ñʽ"ÊÇ¿ÉÑ¡µÄ£¬Ò»°ã²»ÓÃÈ¥¹ÜËû£¬Container.DataItemÊÇÀ¦°óµÄÊý¾ÝÏî,"ת»»ÀàÐÍ"Ö¸µÄÊÇ Integer,String,BooleanÕâÒ»ÀණÎ÷.
4.Ö÷ÒªÃüÃû¿Õ¼ä:
< % @ Import Namespace="System.Data" %> ´¦ÀíÊý¾ÝʱÓõ½
< % @ Import Namespace="System.Data.ADO" % > ʹÓÃADO.net ; ʱÓõ½
< % @ Import Namespace="System.Data.SQL" %> SQL Server Êý¾Ý¿âרÓÃ
< % @ Import Namespace="System.Data.XML" %> ²»Óÿ´´¦ÀíXMLÓõ½
< % @ Import Namespace="System.IO" %> ´¦ÀíÎļþʱÓõ½
< % @ Import Namespace="System.Web.Util" %> ·¢Óʼþʱ´ó¼Ò»áÓõ½
< % @ Import Namespace="System.Text" %> Îı¾±àÂëʱÓõ½
5.Connections(SQLConection »òÕß ADOConnection)µÄ³£ÓÃÊôÐԺͷ½·¨:
| ConnectionString È¡µÃ»òÉèÖÃÁ¬½áÊý¾Ý¿âµÄÓï¾ä
| ConnectionTimeout È¡µÃ»òÉèÖÃÁ¬½áÊý¾Ý¿âµÄ×ʱ¼ä£¬Ò²ÊǾͳ¬Ê±Ê±¼ä
| DataBase È¡µÃ»òÉèÖÃÔÚÊý¾Ý¿â·þÎñÆ÷ÉÏÒª´ò¿ªµÄÊý¾Ý¿âÃû
| DataSource È¡µÃ»òÉèÖÃDSN,´ó¼Ò²»»áÄ°Éú°É£º£©
| Password È¡µÃ»òÉèÖÃÃÜÂë
| UserID È¡µÃ»òÉèÖõǽÃû
| State È¡µÃÄ¿Ç°Áª½áµÄ״̬
| Open() ´ò¿ªÁª½á
| Close() ¹Ø
Ïà¹ØÎĵµ£º
ÔÌûµØÖ·£ºhttp://www.cnblogs.com/clingingboy/archive/2006/07/30/463471.html
asp.net±¾ÉíÌṩÁ˺ܶà¿Ø¼þ,Ìṩ¸øÎÒÃÇÕâЩ±È½ÏÀÁ¶èµÄÈËʹÓÃ,ÎÒÈÏΪ¿Ø¼þµÄ×÷ÓþÍÔÚ´Ë,ÒòΪÎÒÃDz»ÏëÖظ´¹¤×÷,ËùÒÔÒª´´½¨Ëü,Õâ¸ö±¾Éí±ãÊÇ
Ò»¸öÐèÇóµÄ¹Øϵ,ËùÒÔѧϰ¿Ø¼þ¿ª·¢ºÜÓÐÒâ˼.
wroxÍøÕ¾ÉÏÓб¾Êé Professional ASP.NET 2.0 Server Cont ......
1£ºÉÏ´«Í¼Æ¬µÄÏà¶Ô·¾¶µ½Êý¾Ý¿âÖÐÏàÓ¦×Ö¶ÎÀ¶ÁÈ¡ÏÔʾʱ£¬½«¿Ø¼þ£¨¼ÙÉèÓõÄÊÇImage¿Ø¼þ£©µÄImageUrlÊôÐÔÖ¸Ïò¸ÃÏà¶Ô·¾¶¼´¿É¡£
2£º½«Í¼Æ¬ÒÔ¶þ½øÖÆÁ÷µÄ·½Ê½ÕûÌåÉÏ´«µ½Êý¾Ý¿âÀ¶ÁÈ¡ÏÔʾʱ£¬ÒÔ¶þ½øÖÆÁ÷µÄ·½Ê½ÕûÌå¶Á³ö¡£ÕâÖÖ·½·¨ÉÔ΢Âé·³Ò»µã£¬µ«±£´æµÄÊÇͼƬÕûÌåµ½Êý¾Ý¿âÀï¡£
µÚÒ»ÖÖ·½·¨£¬ÊµÏÖÆðÀ´±È½Ï¼òµ¥£¬ÒòΪ´æÈëÊý¾Ý¿ ......
1. µ±ÔÚÒ»¸ö Action ÖÐ ¶ÔÏàͬ¹¦ÄܵÄ2¸ö¿Ø¼þ½øÐи³Öµ
List<SelectListItem> WebSite = GetWebSite();
ViewData["SiteNames"] = WebSite;
if (WebSite.Count > 0)
WebSite.RemoveAt(0);
ViewData["SiteName"] = WebSite;
Ò³ÃæÏÔʾʱ»áͳһÒÔ WebSite ......
±¾ÏµÁÐÎÄÕÂͨ¹ýÒ»¸öÐéÄâµÄ°¸Àý——¡¶MVC¹«¸æ·¢²¼ÏµÍ³¡·µÄ¿ª·¢¹ý³Ì£¬È«ÃæչʾÁËASP.NET MVCµÄ»ù±¾Ê¹Ó÷½·¨£¬Í¬Ê±ÔÚÌÖÂÛÁËÕâ¸ö¿ò¼ÜµÄ»ù±¾ÔÀí¡£
Õâ¸öÎÄÕÂϵÁеÄÄ¿µÄ¾ÍÊÇʹÅóÓÑÃǸüÇáËɵÄÈëÃÅASP.NET MVC¡£
Õâ¸öϵ ......
Ê×Ïȼòµ¥½éÉÜһϠWCF ÊÇʲô£¬È»ºóÔÙ¶Ô WCF ºÍ Asp.net Web service ×ö¸ö±È½Ï¡£
Windows Communication Foundation (WCF) ÊÇÓÃÓÚ¹¹½¨ÃæÏò·þÎñµÄÓ¦ÓóÌÐòµÄ¿ò¼Ü¡£½èÖú WCF£¬¿ÉÒÔ½«Êý¾Ý×÷ΪÒì²½ÏûÏ¢´ÓÒ»¸ö·þÎñÖÕ½áµã·¢ËÍÖÁÁíÒ»¸ö·þÎñÖÕ½áµã¡£·þÎñÖÕ½áµã¿ÉÒÔÊÇÓÉ IIS ³ÐÔصijÖÐø¿ÉÓõķþÎñµÄÒ»²¿·Ö£¬Ò²¿É ......