Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the problem of invalid status information of this page in web

Shulou Source: shulou.com Published: 2022-06-03 05:57:24 11月17日 Update

This article mainly introduces how to solve the problem of invalid status information on this page in web, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.

The situation at that time was as follows:

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

A piece of code from a.aspx.cs

The code is as follows:

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 = 20000pxample timeout of 20 seconds

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:

The copy code is as follows:

Untitled page

The b.aspx.cs code is as follows:

The copy code is as follows:

Public partial class test: System.Web.UI.Page

{

Protected void Page_Load (object sender, EventArgs e)

{

Response.Write ("Hello !")

}

}

Runtime: Label content appears fine for the first time, but prompts you when you don't refresh the page and click the button again.

System.Web.HttpException: the status information of this page is invalid and may be corrupted

The cause of the problem:

It turns out that the first time label loads content, the content loaded is b.aspx.

Hello, ha ha!

The principle should look like this when you click again:

Hello, ha ha!

Hello, ha ha!

So I made a mistake!

The solution is to remove the form tag from b.aspx

Thank you for reading this article carefully. I hope the article "how to solve the problem of invalid status information on this page in web" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Code hello article page information status question content first time value interest again method reason principle at the same time character string situation button Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS Xiaomi Redmi Huawei