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

ASP.NETÍøÕ¾½¨ÉèÖ®´úÂë·ÖÀë

ÔÚÎÒÃÇ´«Í³µÄÍøÕ¾½¨ÉèÖÐͨ³£ÊÇÏÈÉè¼ÆÍøÕ¾Ò³Ã棬ÔÙÀûÓÿª·¢¹¤¾ß£¬ÔÚÍøÕ¾µÄ¿ò¼ÜÄÚ½øÐй¦ÄÜÉè¼Æ¡£ÕâÑùµÄÍøÕ¾½¨Éè´æÔںܶà±×¶Ë£¬ÆäÖÐ×îÍ»³öµÄȱµãÊDz»ÀûÓÚС×鹲ͬ¿ª·¢£¬¸÷»·½ÚÖ®¼äÒÀÀµÐÔÌ«Ç¿¡£
ÔÚASP.NETÖÐÎÒÃÇ¿ÉÒÔÀûÓúǫ́±àÂ룬°ÑHTMLÓû§½çÃæÉè¼Æ£¨ÑÕÉ«¡¢ÃÀѧµÈ£©ÓëÒ³Ãæ´úÂëÇø·Ö¿ªÀ´¡£ÕâÑù¾Í¿ÉÒÔ½â¾öÎÒÃÇС×éµÄ²¢Ðпª·¢ÎÊÌâ¡£
ÆäÖ÷Ìâ˼ÏëÊÇ£ºÃÀ¹¤À´½øÐÐÍøÕ¾Ò³ÃæµÄÉè¼Æ£¬³ÌÐòÔ±¶ÔÍøվҪʵÏֵŦÄÜ·ÖÄ£¿é¿ª·¢¡£´ýµ½Ò³ÃæºÍ¹¦ÄÜÄ£¿é¿ª·¢Íê±Ïºó£¬ÎÒÃÇÖ»ÒªÔÚÃÀ¹¤½çÃæÖжÔÆäHTML´úÂëÉÔ¼ÓÐ޸ģ¬¾Í¿ÉÒÔÍê³É¶ÔÓ¦µÄ¹¦ÄÜ¡£
ÏÂÃæ¾ÍÓÃÒ»¸öСÀý×ÓÀ´½øÐÐ˵Ã÷¡£
³ÌÐòÔ±Íê³ÉµÄ¹¦ÄÜÓÐÈçÏÂÄ£¿é£º
1. ÔÚ×ó±ßµÄColumn1´¦µã»÷£¬ÖмäµÄÈý¸öÄÚÈÝÏÔʾС×éÈýÌõÐÂÎÅ
2. ÔÚColumn2´¦µã»÷£¬ÖмäµÄÈý¸öÄÚÈÝÏÔʾÈý¸öÈËÔ±Çé¿ö
3. ÔÚColumn3´¦µã»÷£¬µ¯³öÒ»¸ö´°¿ÚÏÔʾһÕÅÕÕƬ¡£
ΪÁ˲âÊÔ£¬ÎÒÃÇ¿ÉÒÔ½«ÕâÈý¸ö¹¦Äֱܷ𽻸øÁ½¸ö³ÌÐòÔ±À´×ö¡£
¼×³ÌÐòÔ±£ºÍê³ÉÄ£¿é1ºÍ2
1£® ¼×¿ÉÒÔÏȽ¨Á¢Ò»¸öWebApplication,ÔÚ½çÃæÉÏ·ÅÈëÁ½¸öImageButton:IBtnNews£¬IBtnMemberºÍÁù¸öLabel:Lb1Title,Lb1Detail, Lb2Title,Lb2Detail, Lb3Title,Lb3Detail¡£Éú³ÉÒ»¸öWebÓ¦ÓóÌÐò£¬µã»÷IBNews,Áù¸öLabelÏÔʾС×éÐÂÎÅ£¬µã»÷IBMember,Áù¸öLabelÏÔʾС×éÈýÃû³ÉÔ±¡£ÕâÑùÎÒÃǾÍΪ½¨Á¢Ô´Îļþ´´½¨ºÃÁËÌõ¼þ¡£
2£® ÎÒÃǽ¨Á¢Ò»¸öC#ÀàÎļþCodeBehind.cs¡£
3£® ÓÉÓÚÎÒÃÇÊǽ¨Á¢µÄWeb³ÌÐò£¬ÔòÐèÒªÔÚÌí¼ÓÒýÓÃÖУ¬Ìí¼ÓSystem.Web.dllÓ¦Óá£
4£® È¥µô¹¹Ô캯Êý£¬ÒòΪºǫ́±àÂë²»ÐèÒª´´½¨Àà¡£
5£® ÈÃÀà´ÓPage¶ÔÏóÉϼ̳й¦ÄÜ£¬¼´
public class CodeBehind:System.Web.UI.Page
6£® ½«¸Õ²ÅÉú³ÉµÄWebApplicationÖеÄÏà¹Ø´úÂ븴ÖƽøÀ´£¬Ö÷ÒªÓÐÁ½¸ö²¿·Ö£ºÉùÃ÷²¿·ÖºÍ·½·¨²¿·Ö£¬ÔÚÕâÀï°ÑÓ¦ÓóÌÐòÖеĿɷÃÎʼ¶±ðprotected£¬¸ÄΪpublic£¬ÒòΪֻÓÐÕâÑùÍⲿµÄ´úÂë²Å¿ÉÒÔ·ÃÎÊÎÒÃǵķ½·¨ºÍ±äÁ¿£¬Òª×¢ÒâµÄÊÇÒ³ÃæÉÏËùÓÐÓëºǫ́±àÂëÎļþ½»»§µÄ¿Ø¼þ¶¼ÒªÓÐÒ»¸ö¶ÔÓ¦µÄ±¾µØ±äÁ¿¡£
7£® Éú³ÉÒ»¸öCodeBehind.cs¡£
ÖÁ´Ë£¬¼×³ÌÐòÔ±µÄ¹¤×÷Íê³É¡£ÒÒ³ÌÐòÔ±¿ÉÒÔÓÃͬÑùµÄ·½Ê½Éú³ÉËûµÄCodeBehind.csÎļþ¡£¼×ÒÒÁ½Î»³ÌÐòÔ±½øÐдúÂëºÏ³É£¬Íê³ÉÒ»¸öÍêÕûµÄCodeBehinde.cs;
´úÂëÈçÏ£º
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace codetest
{
public class News:System.Web.UI.Page
{
public System.Web.UI.WebControls.Label Lb1Title;
public System.Web.UI.WebControls.Label Lb1


Ïà¹ØÎĵµ£º

asp.netµ÷ÓÃjs½Å±¾·½·¨

1¡¢Ö±½ÓÔÚǰ̨µ÷Óà javascript º¯Êý 
ºÜ¼òµ¥,ÔÚ head ÔªËØÖ®¼ä¼ÓÈë script ÔªËØ,½« type ÔªËØÉèÖÃΪ " text/javascript " 
Èç:
¸´ÖÆ´úÂë ´úÂëÈçÏÂ:
<head runat="server"> 
<script type="text/javascript" > 
function ShowName(str) 

alert("ÄúµÄÃû×ÖΪ:("+s ......

ÔÚasp.netÖÐ×Ô¶¯¸øurlµØÖ·¼ÓÉϳ¬Á´½Ó

 ÒªÏë×Ô¶¯ÏÔʾ³¬Á´½ÓµÄ¹Ø¼üÔÚÓÚÈçºÎÄÜÕýȷʶ±ð³¬Á´½Ó£¬ºÁÎÞÒÉÎʵģ¬×îÓÐЧµÄ·½·¨ÊÇÓÃÕýÔò±í´ïʽ¡£ÕýÔò±í´ïʽÊÇÓÉÆÕͨ×Ö·û£¨ÀýÈç×Ö·û a µ½ z£©ÒÔ¼°ÌØÊâ×Ö·û£¨³ÆΪԪ×Ö·û£©×é³ÉµÄÎÄ×Öģʽ£¬ÃèÊöÁËÒ»ÖÖ×Ö·û´®Æ¥ÅäµÄģʽ£¬¿ÉÒÔÓÃÀ´¼ì²éÒ»¸ö´®ÊÇ·ñº¬ÓÐijÖÖ×Ó´®¡¢½«Æ¥ÅäµÄ×Ó´®×öÌæ»»»òÕß´Óij¸ö´®ÖÐÈ¡³ö·ûºÏij¸öÌõ¼þµÄ×Ó´®µÈ¡ ......

asp.net×Ô¶¨Òå´íÎó´¦ÀíÒ³ÃæµÄ¼¸ÖÖ·½·¨

ASP.NET ÌṩÈýÖÖÓÃÓÚÔÚ³öÏÖ´íÎóʱ²¶»ñºÍÏìÓ¦´íÎóµÄÖ÷Òª·½·¨£ºPage_Error ʼþ¡¢Application_Error ʼþÒÔ¼°Ó¦ÓóÌÐòÅäÖÃÎļþ (Web.config)¡£
Èç¹ûÄú²»µ÷Óà Server.ClearError »òÕß²¶»ñ Page_Error »ò Application_Error ʼþÖеĴíÎó£¬Ôò½«¸ù¾Ý Web.config ÎļþµÄ <customErrors> ²¿·ÖÖеÄÉèÖô¦Àí´íÎó¡£ÔÚ <cus ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ