传递参数的问题,在JavaScript和C# [英] passing parameters issue in javascript and c#

查看:248
本文介绍了传递参数的问题,在JavaScript和C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

参数包含类似粗体,斜体某种格式信息等事实证明,这是禁止的。

The parameters contain some format information like bold, italic and etc. It turns out that this is prohibited.

有这个文本编辑器和一个按钮。一旦我们点击按钮,我们就文本传递到服务器端,并将其保存在数据库中。

there is this text editor and a button. once we click the button, we would pass the text to the server side and save it in the database.

以下是错误信息:

一个可能是从客户端检测到的危险的Request.QueryString值(文本=; B> EFH&LT ESY< / B> ytry )。

A potentially dangerous Request.QueryString value was detected from the client (text="efh<b>esy</b>ytry").

说明:ASP.NET已检测到有潜在危险,因为它可能包括HTML标记或脚本请求数据。这些数据可能会重新present企图危害您的应用程序,安全性,如跨站点脚本攻击。如果这种类型的输入是在应用程序中适当的,您可以在一个网页code明确地允许它。欲了解更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=212874

Description: ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script. The data might represent an attempt to compromise the security of your application, such as a cross-site scripting attack. If this type of input is appropriate in your application, you can include code in a web page to explicitly allow it. For more information, see http://go.microsoft.com/fwlink/?LinkID=212874.

异常详细信息:System.Web.Htt prequestValidationException:; B&GT; ESY&LT; / B&GT; ytry EFH&LT检测到有潜在危险的Request.QueryString值code>)。

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.QueryString value was detected from the client (text="efh<b>esy</b>ytry").

如何解决这个问题呢?

推荐答案

尝试:

<system.web>
    <compilation debug="true" targetFramework="4.0" />
    <httpRuntime requestValidationMode="2.0" />
    <pages validateRequest="false" />
</system.web>

参考:<一href=\"http://stackoverflow.com/questions/2673850/validaterequest-false-doesnt-work-in-asp-net-4\">ValidateRequest="false"在Asp.Net不起作用4

这篇关于传递参数的问题,在JavaScript和C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆