Home Search Member List Faq Register Login  
UltimateSpellMVC
Spell Checker is throwing an error when I entered any HTML tags in it.

Thread Starter: gauri.rane   Started: 11-07-2012 11:58 PM   Replies: 3
 Karamasoft Support Forums » General Discussions » UltimateSpellMVC » Spell Checker is throwing an error when I entered any HTML tags in it.
 Printable Version    « Previous Thread   Next Thread »
  07 Nov 2012, 11:58 PM
gauri.rane is not online. Last active: 3/1/2013 4:56:50 AM gauri.rane

Top 10 Posts
Joined on 10-12-2012
Posts 17
 Spell Checker is throwing an error when I entered any HTML tags in it.
Hi,

I am bulding an application in ASP.NET MVC 4.0 & my requirement for a particular page is to work spell check button in popup window. My application is working properly in normal Pages as well as in popup. Bt when i enter any html tags in textArea, It throws an error as below:

Server Error in '/test' Application.

A potentially dangerous Request.QueryString value was detected from the client (txt="<html></html>").

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. To allow pages to override application request validation settings, set the requestValidationMode attribute in the httpRuntime configuration section to requestValidationMode="2.0". Example: <httpRuntime requestValidationMode="2.0" />. After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see http://go.microsoft.com/fwlink/?LinkId=153133.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.QueryString value was detected from the client (txt="<html></html>").


BELOW IS THE LINK FOR AN APPLICATION:

https://skydrive.live.com/?cid=AC0852AB8A95E51D&id=AC0852AB8A95E51D%21103

It would be of great help,If u give some solution for this.

Thanks in Advance,
Gauri Rane

  
  08 Nov 2012, 2:12 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Spell Checker is throwing an error when I entered any HTML tags in it.
In your web.config, add requestValidationMode="2.0" to the system.web section as follows:

<system.web>
   <httpRuntime requestValidationMode="2.0" />
</system.web>

Then, in your Controller class (e.g. HomeController.cs), add [ValidateInput(false)] as follows:

[ValidateInput(false)]
public class HomeController : Controller

  
  08 Nov 2012, 3:51 AM
gauri.rane is not online. Last active: 3/1/2013 4:56:50 AM gauri.rane

Top 10 Posts
Joined on 10-12-2012
Posts 17
Re: Spell Checker is throwing an error when I entered any HTML tags in it.
Hi,

Thanks a lot... Its working properly. But i have Query.

Is there any need to change in the controller? which you gave me..bcoz its working even if i didnt change in the controller.

Thanks in Advanced
Gauri Rane

  
  08 Nov 2012, 9:17 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: Spell Checker is throwing an error when I entered any HTML tags in it.
If it is working without the change in the controller, you don't have to use it. It might be needed for cases when you have HTML tags in your text areas and submit your page.
  
 Page 1 of 1 (4 items)
Karamasoft Support Forums » General Discussions » UltimateSpellMVC » Spell Checker is throwing an error when I entered any HTML tags in it.

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.