In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
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!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.