A potentially dangerous Request.Form value was detected from the client

前端 未结 30 2231
刺人心
刺人心 2020-11-21 05:24

Every time a user posts something containing < or > in a page in my web application, I get this exception thrown.

I don\'t want to go

30条回答
  •  既然无缘
    2020-11-21 05:54

    If you're using framework 4.0 then the entry in the web.config ()

    
        
            
        
    
    

    If you're using framework 4.5 then the entry in the web.config (requestValidationMode="2.0")

    
        
        
    
    

    If you want for only single page then, In you aspx file you should put the first line as this :

    <%@ Page EnableEventValidation="false" %>
    

    if you already have something like <%@ Page so just add the rest => EnableEventValidation="false" %>

    I recommend not to do it.

提交回复
热议问题