asp.net ·¢²¼ÍøÕ¾
asp.net ·¢²¼ÍøվʱÓÐÈý¸öÑ¡Ï
1¡¢ÔÊÐí¸üдËÔ¤±àÒëÕ¾µã£ºasp.net web Ò³Ãæͨ³£°üº¬Á½¸öÒ³Ã棬һ¸ö¼´ .aspx Ò³£¬»¹ÓÐÒ»¸ö .aspx.cs Îļþ£¬ºóÒ»¸öÎļþÊÇ»ù±¾Î¯ÍеÄʼþÏìÓ¦Îļþ´úÂ룻´Ë´¦ÔÊÐí¸üдËÔ¤±àÒëÕ¾µãµÄÒâ˼¾ÍÊÇ£º.aspx Ò³¿É¸ù¾ÝÐèÒª½øÐÐÒ»¶¨µÄ¸üУ¬¶ø .aspx.cs ±àÒë³ÉµÄ .dll ±£³Ö²»±ä£»ÁíÍ⣬Èç¹û·¢²¼Íøվʱֻѡ´ËÒ»ÏîµÄ»°£¬Bin Îļþ¼Ð .dll ÎļþµÄÉú³É¹æÔò£ºa¡¢ÒÔÎļþ¼ÐΪµ¥Î»£»b¡¢Óû§¿Ø¼þ£»c¡¢Ä£°åÒ³(.master)£»
2¡¢Ê¹Óù̶¨ÃüÃûºÍµ¥Ò³³ÌÐò¼¯£ºÕâ¸öºÍÔÀ´µÄ²î±ð¾ÍÊÇ£¬Bin Îļþ¼Ð .dll ÎļþÉú³É¹æÔò±äΪ£¬Ã¿¸ö .aspx.cs Ò³Éú³ÉÒ»¸ö .dll Îļþ£»ÕâÀï·¢²¼µÄʱºò×îºÃµÚÒ»ÏîҲѡÉÏ£¬±ãÓÚÐÞ¸ÄһЩ¼òµ¥µÄÒ³Ã棻
3¡¢¶ÔÔ¤±àÒë³ÌÐò¼¯Ê¹ÓÃÇ¿ÃüÃû£º°üÀ¨Á½¸öÑ¡Ïa¡¢Ê¹ÓÃÓÉÇ¿Ãû³Æ¹¤¾ßÉú³ÉµÄÃÜÔ¿Îļþ£»b¡¢Ê¹ÓÃÃÜÔ¿ÈÝÆ÷£»Õâ¸öÔÝʱûÓõ½£¬²»×÷¹ý¶àµÄ˵Ã÷
Ïà¹ØÎĵµ£º
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 ......
½ñÔçÓиöÍøÓÑÎʵ½ÎÒÕâÎÊÌ⣬ÒÔÇ°ÎÒ¶¼ÊÇÖ±½ÓÔÚÊý¾Ý¿âÖдæÎļþÃûµÄ£¬»¹Ã»ÓÐÊÔ¹ý´æ´¢ÕûÕÅͼƬµ½Êý¾Ý¿âÖУ¬ÉÏÍøËÑË÷ÁËһϣ¬×Ô¼ºÓÖ²âÊÔÁËÒ»·¬£¬´úÂëÈçÏ£º
½¨Á¢±£´æͼƬµÄ±íµÄSQLÓï¾ä£º
Sql´úÂë < width="14" height="15" src="javascripts/syntaxhighlighter/clipboard_new.swf" pluginspage="http://w ......
1.Asp.NetÖм¸ÖÖÏàËƵıê¼Ç·ûºÅ: < %=...%>< %#... %>< % %>< %@ %>½âÊͼ°Ó÷¨
´ð: < %#... %>: ÊÇÔڰ󶨿ؼþDataBind()·½·¨Ö´ÐÐʱ±»Ö´ÐУ¬ÓÃÓÚÊý¾Ý°ó¶¨
Èç: < %# Container.DataItem("tit") %>
< %= %>: ÔÚ³ÌÐòÖ´ÐÐʱ±»µ÷Ó㬿ÉÒÔÏÔʾºǫ́±äÁ¿Öµ
Èç:
*.aspxÖУº < %= a ......
֮ǰÓõÄÔÚÏß±à¼Æ÷ÊÇDotNetTextBox £¬²¢ÇÒÔøÒ»¶È¾õµÃËüÒ쳣ǿ´ó£¬Èç¿ÉÒÔ¸øÉÏ´«µÄͼƬ¼ÓÎÄ×Öˮӡ»òÕßͼƬˮӡ£¬µ«ºóÀ´·¢ÏÖÆäÉÏ´«µÄͼƬ²»ÈÝÒ×¹ÜÀí£¬¶¼¼·ÔÚÒ»¸öÎļþ¼ÐÀïÃ棨Ãâ·Ñ°æ£¬¸¶·Ñ°æºÃÏñ¿ÉÒÔ·ÖÎļþ¼ÐÉÏ´«±£´æͼƬ£©£¬²¢ÇÒ¶ÎÊ׿ոñ×ܲ»ÊÇËù¼û¼´ËùµÃ£¬ÎÒ±à¼Ê±¿ÕÁËÁ½¸ö×Ö·ûµÄλÖ㬵½ÁËǰ̨ҳÃæµÄʱºòÖ»ÓÐÒ»¸ö×Ö·û£¬ËùÒÔ ......