錯誤:WebForms.PageRequestManagerServerErrorException

來源:互聯網
上載者:User

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

Sys.WebForms.PageRequestManagerServerErrorException: 在伺服器上處理請求時出現未知錯誤。伺服器返回的狀態代碼為: 500

這個錯誤可能原因不止一個,我的錯誤原因是頁面上出現了編譯系統認為危險的字元(在<textarea>中出寫了"<div>")。這個“<div>”我這裡是不需要的,因此我的解決辦法是去掉了這個“<div>”字串。

而如果需要的話,可以在頁首加入 ValidateRequest="false",使其不校正危險字串

如下:

<%@ Page Language="C#" ..... ValidateRequest="false" %>

其他網上查到的解決辦法:

1,

顯示詳細的錯誤資訊的方法:

在 ScriptManager  內添加 EnablePartialRendering="false", 會顯示更加詳細的錯誤資訊。

如下:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false"/>

 

一般的原因都是頁面存在潛在的危險字元  在 頁首加入 ValidateRequest="false"  

如下:

<%@ Page Language="C#" MasterPageFile="~/MasterPages/CompanyManage.master" AutoEventWireup="true" CodeFile="CompanyIntroEdit.aspx.cs" Inherits="CompanyIntroEdit" Title="Untitled Page" ValidateRequest="false" %>

2,

在Web.Config

<system.web>

      <pages enableEventValidation="false"/>

</system.web>

這個方法對於我當時的問題沒有效果,暫時還不知道是什麼情況用的。

3,

從。。。。中檢測到有潛在危險的 Request.Form 值。 也就是我當時的問題

解決辦法:

 <!--在頁首加這一句,就不會提示:從用戶端檢測到有潛在危險的Request.Form 值 -->

如下:

<%@ Page Language="C#" ..... ValidateRequest="false" %>

也可以在webconfig加上

 <pages validateRequest="false"/>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.