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

asp.netÌá½»html±ê¼ÇºóµÄ×îÓÅ°²È«´¦Àí

ASP.Net 1.1ºóÒýÈëÁ˶ÔÌá½»±íµ¥×Ô¶¯¼ì²éÊÇ·ñ´æÔÚXSS(¿çÕ¾½Å±¾¹¥»÷)µÄÄÜÁ¦¡£µ±Óû§ÊÔͼÓÃÖ®ÀàµÄÊäÈëÓ°ÏìÒ³Ãæ·µ»Ø½á¹ûµÄʱºò£¬ASP.NetµÄÒýÇæ»áÒý·¢Ò»¸ö HttpRequestValidationExceptioin¡£Ä¬ÈÏÇé¿öÏ»᷵»ØÈçÏÂÎÄ×ÖµÄÒ³Ã棺
ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
Server Error in '/YourApplicationPath' Application
A potentially dangerous Request.Form value was detected from the client
(txtName="<b>").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.
Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (txtName="<b>").
....
¡¡¡¡ÕâÊÇASP.NetÌṩµÄÒ»¸öºÜÖØÒªµÄ°²È«ÌØÐÔ¡£ÒòΪºÜ¶à³ÌÐòÔ±¶Ô°²È«Ã»ÓиÅÄÉõÖÁ¶¼²»ÖªµÀXSSÕâÖÖ¹¥»÷µÄ´æÔÚ£¬ÖªµÀÖ÷¶¯È¥·À»¤µÄ¾Í¸üÉÙÁË¡£ASP.NetÔÚÕâÒ»µãÉÏ×öµ½Ä¬ÈÏ°²È«¡£ÕâÑùÈö԰²È«²»ÊǺÜÁ˽âµÄ³ÌÐòÔ±ÒÀ¾É¿ÉÒÔд³öÓÐÒ»¶¨°²È«·À»¤ÄÜÁ¦µÄÍøÕ¾¡£
¡¡¡¡µ«ÊÇ£¬µ±ÎÒGoogleËÑË÷ HttpRequestValidationException »òÕß "A potentially dangerous Request.Form value was detected from the client"µÄʱºò£¬¾ªÆæµÄ·¢Ïִ󲿷ÖÈ˸ø³öµÄ½â¾ö·½°¸¾¹È»ÊÇÔÚASP.NetÒ³ÃæÃèÊöÖÐͨ¹ýÉèÖà validateRequest=false À´½ûÓÃÕâ¸öÌØÐÔ£¬¶ø²»È¥¹ØÐÄÄǸö³ÌÐòÔ±µÄÍøÕ¾ÊÇ·ñÕæµÄ²»ÐèÒªÕâ¸öÌØÐÔ¡£¿´µÃÎÒÕâ½ÐÒ»¸öµ¨Õ½Ðľª¡£°²È«ÒâʶӦ¸Ãʱʱ¿Ì¿ÌÔÚÿһ¸ö³ÌÐòÔ±µÄÐÄÀ²»¹ÜÄã¶Ô°²È«µÄ¸ÅÄîÁ˽â¶àÉÙ£¬Ò»¸öÖ÷¶¯µÄÒâʶÔÚÄÔ×ÓÀÄãµÄÕ¾µã¾Í»á°²È«ºÜ¶à¡£
¡¡¡¡ÎªÊ²Ã´ºÜ¶à³ÌÐòÔ±ÏëÒª½ûÖ¹ validateRequest ÄØ?ÓÐÒ»²¿·ÖÊÇÕæµÄÐèÒªÓû§ÊäÈë"<>"Ö®ÀàµÄ×Ö·û¡£Õâ¾Í²»±Ø˵ÁË¡£»¹ÓÐÒ»²¿·ÖÆäʵ²¢²»ÊÇÓû§ÔÊÐíÊäÈëÄÇЩÈÝÒ×ÒýÆðXSSµÄ×Ö·û£¬¶øÊÇÌÖÑáÕâÖÖ±¨´íµÄÐÎʽ£¬±Ï¾¹Ò»´ó¶ÎÓ¢ÎļÓÉÏÒ»¸öASP.NetµäÐÍÒì³£´íÎóÐÅÏ¢£¬ÏÔµÃÕâ¸öÕ¾µã³ö´íÁË£¬¶ø²»ÊÇÓû§ÊäÈëÁË·Ç·¨µÄ×Ö·û£¬¿ÉÊÇ×Ô¼ºÓÖ²»ÖªµÀÔõô²»ÈÃË


Ïà¹ØÎĵµ£º

¹ØÓÚASP.NETÒ³Ãæ´òÓ¡¼¼ÊõµÄ×ܽá

ÍøÂç´òÓ¡¸ÅÊö
¡¡¡¡• B/S½á¹¹µ¼ÖÂÁËWebÓ¦ÓóÌÐòÖдòÓ¡µÄÌØÊâÐÔ¡£
¡¡¡¡• ³ÌÐòÔËÐÐÔÚä¯ÀÀÆ÷ÖУ¬´òÓ¡»úÔÚ±¾µØ£¬¶øÎļþÈ·¿ÉÄÜÔÚ·þÎñÆ÷ÉÏ£¬µ¼ÖÂÁË´òÓ¡¿ØÖƲ»ÊǺÜÁé»î¡£
¡¡¡¡• ¸ñʽÈçºÎ¿ØÖƺͶ¨ÖƵȣ¬ÊÇÎÒÃÇ¿ª·¢ÖпÉÄÜ»áÃæ¶ÔµÄÎÊÌâ¡£
¡¡¡¡´òÓ¡ÎĵµµÄÉú³É
¡¡¡¡• 1¡¢¿Í»§¶Ë½Å±¾·½Ê½
¡¡¡¡Ò»°ãÇé¿öÏ£¬Ö÷ÒªÊ ......

ÓÃasp.netʵÏֵİѱ¾ÎÄÍƼö¸øºÃÓѹ¦ÄÜ


     ///<summary>
  ///<author>·ÉÓ¥@ASPCool.com</author>
  ///<description>±¾ÎÄÓÃasp.netʵÏÖ°Ñ´ËÎÄÍƼö¸øºÃÓѵŦÄÜ¡£</desciption>
  ///<copyright>ASP¿á¼¼Êõ×ÊѶÍø(www.ASPCool.com)</copyright>
  ///</summary ......

¹ØÓÚASP.netÓëAJAXÓÃgridview½øʵÏÖÎÞˢв¢·ÖÒ³Ëæ±Ê

¿ª·¢»·¾³:WIN XP   VS2005
Êý¾Ý¿â:SQL server 2000
´Ë´¦²»¿¼ÂÇ°²È«ÎÊÌâ.
¾ßÌåÈçÏÂ:
Ê×ÏȽ¨Á¢Ò»¸öÊý¾Ý¿âºÍÒ»¸ö±í½á¹¹²¢ÔÚ±íÖÐÊäÈëһЩÊý¾ÝÒÔ±ã²âÊÔ:´Ë²½ÂÔ¹ý
´ò¿ªVS2005н¨Ò»¸öÍøÕ¾²¢Ìí¼ÓÒ»¸öHTMLÒ³
ÔÚĬÈϵÄDefault.aspxÖзÅÈëGridview¿Ø¼þÓÃÓÚÏÔʾÊý¾Ý
.cs´úÂë
using System;
using System.Data;
usi ......

ASP.NET 2.0ÖÐÖ±½ÓµÃµ½±¾Ò³ÃæÉú³ÉµÄHTML´úÂë


ÔÚASP.NET 2.0ÖУ¬ÓÐʱºòÐèÒª¶ÔASP.NETÉú³ÉµÄHTML´úÂë½øÐд¦Àí£¬»òÕßÊDZ£´æ³É¾²Ì¬Îļþ¡£ASP.NET Ìá
¹©ÁËÖ±½Ó½«ÇëÇó±£´æ³ÉÎļþµÄ·½·¨£ºHttpRequest.SaveAs·½·¨¡£ÏÂÃæÕâ¸ö·½·¨¾ÍÊÇÔÚASP.NET 2.0Öеõ½
ASP.NETÉú³ÉµÄHTML´úÂ룬ͬʱ£¬Éú³ÉÒ»¸ö¾²Ì¬ÎļþµÄ·½·¨¡£
C#
<%@ Page Language="C#" AutoEventWireup="true" %&g ......

Asp.NetÖж¯Ì¬¼ÓÔؿؼþ


ÎÒÃÇÔÚAsp.Net¿ª·¢¹ý³ÌÖУ¬ÓÐʱºòΪÁË¿ª·¢µÄÐèÒª£¬»ò´ïµ½Ò»¶¨µÄЧ¹û£¬ÎÒÃÇ»á²ÅÈ¡¶¯Ì¬¼ÓÔØÓû§¿Ø¼þµÄ·½·¨À´ÊµÏÖ£¬¶¯Ì¬¼ÓÔØÓû§¿Ø¼þ£¬¿ÉÒÔÔÚͬһ¸öÒ³ÃæÀïÃ棬¸ù¾Ý²»Í¬µÄÇé¿öÏÔʾ²»Í¬µÄÄÚÈÝ£¬Ê¹ÎÒÃÇÔÚ¿ª·¢Ê¡Ê±Ê¡Á¦¡£
¡¡ÄÇôÎÒÃÇÔõôʵÏÖ¶¯Ì¬¼ÓÔØÓû§¿Ø¼þÄØ£¬ÆäʱºÜ¼òµ¥£¬ÎÒÃÇÖ»ÒªÔÚÒ³ÃæÀïÒª·Å¿ØµÄ¼þµÄµØ·½·ÅÒ»¸öռλ¿Ø¼þ &l ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ