The status information on this page is invalid. It may have been damaged

  • 2020-06-12 08:52:04
  • OfStack

Here's what happened:

The a.aspx page executes an URL string to access b.aspx and then the b page returns a value to a

a. aspx. cs 1 block of code


                            string result = "";
                            string url = "http://localhost:1759/textWeb/b.aspx";
                            result =exec_url(url);
                            Label1.Text = result;
    public string exec_url(string url) 
    {
        string result = "1";
        WebRequest request = WebRequest.Create(url);
        try
        {
            request.Timeout = 20000;//20 Second timeout  
            WebResponse response = request.GetResponse();
            Stream resStream = response.GetResponseStream();
            StreamReader sr = new StreamReader(resStream);
            result = sr.ReadToEnd();
            sr.Close();
            resStream.Close();
        }
        catch
        {
            return "1";
        }
        return result;
    }

b. aspx page code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title> No title page </title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    
    </div>
    </form>
</body>
</html>

b. aspx. cs code:

public partial class test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(" hello   Ha ha! ");
    }
}

Runtime: Label content appears normally at the first session but will prompt when you click the button without refreshing the page

System. Web. HttpException: The status information on this page is invalid and may be corrupted

Causes:

It turns out that the first time label loaded the content, the load was ES40en.aspx

< form >

Hello, haha!

< /form >

Click again and the principle should look like this:

< form >

Hello, haha!

< form >

Hello, haha!

< /form >

< /form >

So there was a mistake!

The solution: Remove the form tag from ES84en.aspx


Related articles: