ASP.NETÖÐÑéÖ¤¿Ø¼þµÄʹÓÃ
Ç°ÑÔ£º
Ç°¼¸ÈÕ£¬ÎÞÄÎÓÃJSÅжϿؼþµÄÓÐЧÐÔ£¬·¢ÏÖµÄÈ·ÊÇÒ»¼þ·ÑÁ¦¡¢·ÑÉñµÄÊÂÇ飡ÌرðÊÇÕë¶ÔÓʼþ¸ñʽ¡¢ÓÊÕþ±àÂëµÈµÄ¹ØÓÚÕýÔò±í´ïʽµÄJSÑéÖ¤£¨ÆäÖÐÉæ¼°ÕýÔò±í´ïʽµÄ±È½ÏµÈ£¬½Ï·³~£©¡£Æäʵ¶ÔÓÚÕâЩ³£ÓõĿؼþÓÐЧÐÔÑéÖ¤£¬ÔÚAsp.NetÖÐÓе¥¶ÀµÄÑéÖ¤¿Ø¼þ¿É¹©Ê¹Óá£ËûÃÇ¿ÉÒÔÂú×ãÒ»°ãµÄ£¬ÖîÈç·Ç¿Õ£¬·¶Î§¡¢±È½ÏµÈµÄÑéÖ¤¡£
ÑéÖ¤¿Ø¼þ£º
Asp.NetÖÐÄÚÖõÄÑéÖ¤¿Ø¼þÓУºRequiredFieldValidation¡¢RangeValidation¡¢RegularExpressValidation¡¢CompareValidation¡¢CustomValidationºÍValidationSummaryµÈÁùÖÖ¡£ÆäÖÐÓû§×Ô¶¨ÒåÑéÖ¤¿Ø¼þ£¬ÓÉÓÚ²¢²»·Ç³£³£Óã¨Òª×Ô¶¨ÒåºÜ¶à³É·Ö£¬°üÀ¨º¯ÊýµÈ£©£¬ÔÚ´ËÎIJ»ÓèÂÛÊö¡£
¼òµ¥µÄÑéÖ¤½çÃæÈçÏ£¨DesignÊÓͼ£©£º
ÈçͼչʾÁËÑ¡È¡»·¾³£¬ÓұߺìÉ«×ÖÌåΪÑéÖ¤¿Ø¼þµÄErrorMessageÐÅÏ¢¡£Éè¼ÆµÄ»·¾³²¼ÖÃÈçÏ£º
1£© RequiredFieldValidation¿Ø¼þ£¬ÆäControlToValidateÊôÐÔΪÐÕÃû¶ÔÓ¦Îı¾¿ò¡£¶ÔÓÚControlToValidateÊôÐÔ£¬Ã¿Ò»¸öÑéÖ¤¿Ø¼þ¾ù¶ÔÓ¦Ò»¸ö£¬×÷ΪÑéÖ¤µÄÖ÷Ì壻
2£©RangeValidation¿Ø¼þ£¬ ÆäControlToValidateÊôÐÔΪÄêÁä¶ÔÓ¦Îı¾¿ò£»
3£© CompareValidation¿Ø¼þ£¬ ÆäControlToValidateÊôÐÔΪÃÜÂëÈ·È϶ÔÓ¦Îı¾¿ò¡£Í¬Ê±»¹ÓÐÒ»¸öÈÝÒ׺ÍControlToValidateÊôÐÔÏà»ìÏýµÄÊôÐÔ£ºControlToCompareÊôÐÔ£¬Æä¶ÔÓ¦ÃÜÂë¶ÔÓ¦Îı¾¿ò¡£Çø·Ö£ºµÄÒªµã¼´ÊÇ·ÖÇåÖ÷Ì壬´ËʱÑéÖ¤µÄÖ÷ÌåÊÇÃÜÂëÈ·È϶ÔÓ¦¿ò£¬ÔÚÓÃoperatorʱ£¨µÈÓÚ¡¢´óÓÚ¡¢Ð¡ÓÚ£©£¬ÊDZȽϵÄÖ÷Ì壬ºÍ±»±È½ÏµÄÎı¾¿òÏà±È½Ï£¬ÕâÀï¼´ÊÇÃÜÂë¶ÔÓ¦Îı¾¿ò¡£
4£©RegularExpressValidation¿Ø¼þ£¬ ÆäControlToValidateÊôÐÔΪÓÊÏä¶ÔÓ¦Îı¾¿ò£»
5) ValidationSummary¿Ø¼þ£¬Ëü²»¾ß±¸ControlToValidateÊôÐÔ£»
Æä¶ÔÓ¦µÄǰ̨´úÂëΪ£º
<head runat="server">
<title>ÑéÖ¤¿Ø¼þµÄÑÝʾҳÃæ</title>
<script type ="text/javascript" >
// Description: ͨ¹ýÖð¸öÑÝʾÑéÖ¤¿Ø¼þµÄʹÓã¬×÷Ϊ¸´Ï°
// CopyRight: http://www.cnblogs.com/yangmingming
// Notes: ²ÉÓÃÒ»ÕÅÄ£ÄâÓû§±íµÄÀý×ÓÑéÖ¤
</script>
</head>
<body>
<form id="form1" runat="server">
&nbs
Ïà¹ØÎĵµ£º
+++ Ò³Ãæ´úÂëÈçÏ£º
<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1"
AutoGenerateColumns="true" DataKeyNames="EMPNO">
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetEmp" TypeName="O ......
+++ Ò³Ãæ´úÂëÈçÏ£º
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" PageSize="3"
AutoGenerateColumns="true" DataKeyNames="username" DataSourceID="SqlDataSource1"
AutoGenerateDeleteButton="True"
AutoGen ......
Ç°¶Îʱ¼äÒòΪһÌض¨ÐèÇóдÁËÏÂÃæ´úÂë¡£ÐèÇóÈçÏ£ºÔÚÓû§·ÃÎʱ¾Õ¾ËùÓÐaspxÒ³Ãæʱ£¬Ê×ÏÈÅжÏÓû§Session["login"]ÊÇ·ñ´æÔÚ£¬Èç¹û²»´æÔÚ£¬ËµÃ÷¸ÃÓû§Î´µÇ½£¬ÒªÈøÃÓû§Ìøתµ½Ö¸¶¨µÄÒ³Ãæ¡£ËùÒÔÏëдһ¸öSessionµÄ¹ýÂËÆ÷£¬Ë¼Ç°ÏëºóÓ¦¸Ãдһ¸ö¼Ì³ÐIHttpModuleµÄ´¦ÀíÀà¡£ÊÔÑéÁ˼¸ÖÖ·½Ê½·¢ÏÖÖ»Óн«·½·¨¼ÓÔÚ.AcquireRequestStateÖвŠ......
½ñÌìÎÒÃǼÌÐøÍê³É Õâ¸ö MVC2 ¼òµ¥ÊµÀýµÄÊ£Ó๦ÄÜ£ºÏÔʾÃ÷ϸ¡¢Ìí¼Ó¡¢±à¼µÈ¡£¡£¡£¡£¡£
Ò»¡¢ÏÔʾÃ÷ϸ
¡¡¡¡ÔÚ MoviewsControllerÖÐµÄ Details·½·¨Àï ÓÒ¼ü--Add view£¬´´½¨Ò»¸öÇ¿ÀàÐ͵ÄÊÓͼ
¡¡¡¡
¡¡¡¡
È·¶¨ºó£¬Õâ¸öÃ÷ϸµÄÊÓͼÎļþ¾ÍÒѾÉú³É¡£¡£¡£
´Ëʱ£¬ÎÒÃÇÐèÒªÐÞ¸Ä Detials ·½·¨£¬¸ù¾Ý ´«µÝ¹ýÀ´µÄ id²ÎÊý£¬È¥Êý¾Ý¿â²éÑ ......