SoFunction
Updated on 2025-03-07

The status information of this page is invalid and may be corrupted.

The situation at that time was as follows:

Page Execute a URL string access and then page b returns a value to a

A piece of code

Copy the codeThe code is as follows:

                            string result = "";
                            string url = "http://localhost:1759/textWeb/";
                            result =exec_url(url);
                            = result;

    public string exec_url(string url)
    {

        string result = "1";
        WebRequest request = (url);
        try
        {
= 20000;//20 seconds timeout
            WebResponse response = ();

            Stream resStream = ();
            StreamReader sr = new StreamReader(resStream);
            result = ();
            ();
            ();
        }
        catch
        {
            return "1";
        }
        return result;

    }


Page code:
Copy the codeThe code is as follows:

<html xmlns="http:///1999/xhtml">
<head runat="server">
<title>Unt title page</title>
</head>
<body>
    <form runat="server">
    <div>

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

The code is as follows:
Copy the codeThe code is as follows:

public partial class test :
{
    protected void Page_Load(object sender, EventArgs e)
    {
("Hello haha!");
    }
}

Runtime: The first time the Label content displays normally, but when you don’t refresh the page and click the button, it will be prompted

: The status information of this page is invalid and may be corrupted

Cause of the problem:

It turns out to be like this: the content loaded when the label is first loaded

<form>

Hello Haha!

</form>

The principle should look like this when clicking again:

<form>

Hello Haha!

<form>

Hello Haha!

</form>

</form>

So something went wrong!

The solution is: remove the form tag