-1

嗨,当我尝试发布此文本框文本时,出现此错误。

“Sys.WebForms.PageRequestManagerServerErrorException:处理服务器上的请求时发生未知错误。从服务器返回的状态代码为:500”

我的页面:

<%@ Page Title="" Language="C#" MasterPageFile="~/Yonetim/Yonetim.Master" AutoEventWireup="true"
CodeBehind="ImzaDetay.aspx.cs" Inherits="Yonetim.Detay" ValidateRequest="false" EnableEventValidation="false"%>

我的文本框:

<asp:TextBox ID="txt_SQL_STR" TextMode="MultiLine" runat="server" Width="100%"
                                                        Height="1000px" />

我试试这个:

<%@ Page ValidateRequest="false" %>

但我得到了同样的错误。

这个对我有用 :

CREATE TABLE EMPLOYEE3 AS
   (SELECT PROJNO, PROJNAME, DEPTNO
    FROM EMPLOYEE
    WHERE DEPTNO = 'D11') WITH NO DATA

它让我疯狂!:

SELECT 
       DATED,
       decode(dated,TRUNC(SYSDATE),'<div style="color: red;">') || to_char(t.dated,'dd.mm.yyyy') || decode(dated,TRUNC(SYSDATE),'</div')   DATED2,
       to_char(t.dated,'dd.mm.yyyy') DATED3,
       WEEK_NO  week_no,
       decode(dated,TRUNC(SYSDATE),'<div style="color: red;">') || WEEK_DAY  || decode(dated,TRUNC(SYSDATE),'</div') week_day  ,
       decode(dated,TRUNC(SYSDATE),'<div style="color: red;">') || CUSTOMER_ID  || decode(dated,TRUNC(SYSDATE),'</div') customer_id  ,
       decode(dated,TRUNC(SYSDATE),'<div style="color: red;">') || c_inf_api.get_name(t.customer_id) || decode(dated,TRUNC(SYSDATE),'</div') customer_name ,
       XXX_TABLE,
       XXX_TABLE,
       XXX_TABLE,
       XXX_TABLE,
       t.YYY_TABLE,
       T.OBJID,
       T.OBJVERSION,
       decode(dated,TRUNC(SYSDATE),'<div style="color: red;">') || T.STATE || decode(dated,TRUNC(SYSDATE),'</div')   state

FROM time_db_qry t,
     p_info p
WHERE p.person_id=t.person_id
AND t.dated BETWEEN trunc(SYSDATE)-4 AND trunc(SYSDATE) + 25
and p.user_id='XXXXX'
ORDER BY dated
4

1 回答 1

2

我以前见过这个。看起来您将 html 标记放在文本框中,然后发布表单。出于安全原因,Asp.Net 捕获并抛出错误。它会使您的应用程序的安全性稍差一些,但如果您确实需要传递该 html,这将起作用:

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

看来您也可以只为一页执行此操作。

<location path="XX/YY">
    <system.web>
        <httpRuntime requestValidationMode="2.0" />
    </system.web>
</location>

信用到期的信用

于 2012-04-13T16:29:09.700 回答