Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server."

前端 未结 27 2429
遇见更好的自我
遇见更好的自我 2020-12-13 18:03

I have couple of update panels and jquery tabs on page. And also I am loading couple user controls on update panels. After user waited for couple of minutes (not checked the

相关标签:
27条回答
  • 2020-12-13 18:23

    For me the problem was that I was using a <button> instead of a <asp:LinkButton>

    0 讨论(0)
  • 2020-12-13 18:24

    @JS5 , I also faced the same issue as you: ImageButton causing exceptions inside UpdatePanel only on production server and IE. After some research I found this:

    There is an issue with ImageButtons and UpdatePanels. The update to .NET 4.5 is fixed there. It has something to do with Microsoft changed the x,y axis of a button click from Int to Double so you can tell where on the button you clicked and it's throwing a conversion error.

    Source

    I'm using NetFramework 2.0 and IIS 6, so, the suggested solution was to downgrade IE compatibility adding a meta tag:

    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    

    I've done this via Page_Load method only on the page I needed to:

    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim tag As HtmlMeta = New HtmlMeta()
    
        tag.HttpEquiv = "X-UA-Compatible"
        tag.Content = "IE=9"
    
        Header.Controls.Add(tag)
    End Sub
    

    Hope this helps someone.

    0 讨论(0)
  • 2020-12-13 18:24

    as my friend @RaviKumar mentioned above one reason of following problem is that some piece of data transferred from code to UI contain raw html tags which make request invalid for example I had a textarea and in my code I had set its value by code below

    txtAgreement.Text = Data.Agreement

    And when I compiled the page I could see raw html tag inside textarea so I changed textarea to div on which innerhtml works and render html (instead of injecting raw html tags into element) and it worked for me

    happy coding

    0 讨论(0)
  • 2020-12-13 18:25

    I got this error when I had my button in the GridView in an UpdatePanel... deubbing my code I found that the above error is caused because of another internal error "A potentially dangerous Request.Form value was detected from the client"

    Finally I figured out that one of my TextBoxes on the page has XML/HTML content and this in-turn causing above error when I removed the xml/HTML and tested the button click ... it worked as expected.

    0 讨论(0)
  • 2020-12-13 18:25

    I also faced the same issue , and none of these worked. In my case this was fixed by adding these lines in config file.

    <appSettings>
      <add key="aspnet:MaxHttpCollectionKeys" value="100000" />
    </appSettings>
    
    <system.web.extensions>
      <scripting>   
        <scriptResourceHandler enableCompression="false" enableCaching="true"/>       
      </scripting>
    </system.web.extensions> 
    
    0 讨论(0)
  • 2020-12-13 18:27

    My fix for this was to remove any HTML markup that was in the Text="" property of a TextBox in my asp.net code, inside an update panel. If you have more than one update panel on a page, it will affect them all, which makes it harder to work out which panel has the issue. Chris's answer above lead me to find this, but his is a very hidden answer but I think a very relevant one so here is an answer explained.

    <asp:TextBox ID="bookingTBox" runat="server" ToolTip="" Width="150px" Text="<Auto Assigned>" CssClass="textboxItalicFormat"></asp:TextBox>
    

    The above code will give this error.

    The below will not.

    <asp:TextBox ID="bookingTBox" runat="server" ToolTip="" Width="150px" Text="Auto Assigned" CssClass="textboxItalicFormat"></asp:TextBox>
    

    In the second textbox code I have removed the < and > from the Text="" property. Please try this before spending time adding lines of script code, etc.

    0 讨论(0)
提交回复
热议问题