[英]Using Tinymce results in Internal server error in asp.net
我在我的網頁和客戶端使用Tinymce,一切正常。 但是,當我嘗試訪問頁面控件后面的代碼中的tinymce文本框時,不會呈現。 我的意思是頁面加載沒有渲染。 這是我的HTML代碼
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RichText.aspx.cs" Inherits="TESTING.RichText"
ValidateRequest="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Rich Text</title>
<script src="<%=ResolveClientUrl("~/Script/jquery-ui-1.7.1.custom.min.js") %>" type="text/javascript"></script>
<script type="text/javascript" src="Scirpt/tinymce/jscripts/tiny_mce/tiny_mce.js"> </script>
<script type="text/javascript" src="Scirpt/tinymce/jscripts/tiny_mce/InitializeRichTextBox.js"> </script>
</head>
<body>
<form id="form1" runat="server">
<div style="width: 400px">
<div style="height: 100px; width: 100%;">
</div>
<asp:TextBox ID="TextBox1" runat="server" TextMode="multiline" CssClass="RichTextBox"
Width="150px"></asp:TextBox>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</form>
</body>
</html>
這是我的Code Behind代碼
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace TESTING
{
public partial class RichText : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string here = TextBox1.Text;
}
}
}
當我留下空文本然后頁面加載渲染時,當我寫東西並單擊Button
然后發生此錯誤A potentially dangerous Request.Form value was detected from the client (TextBox1="<ul><li><em><span ...").
我試圖在互聯網上找到解決方案但無法找到解決方案。 請幫我找出解決方案。
在Web.config中添加它
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
</configuration>
並在Page指令中添加ValidateRequest = "false"
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" ValidateRequest="false" %>
供您參考, 請點擊此處
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.