When so many pieces of things are generated, this piece of things has no benefit to Seo at all. What I want to do is remove it, but one thing is to remove it, but it cannot change its original controls and content. Let's look at this section.Code:
When so many pieces of things are generated, this piece of things has no benefit to Seo at all. What I want to do is remove it, but one thing is to remove it, but it cannot change its original controls and content, for example, it cannot be used. So all I have to do is save the data in another way. This is a piece of base64-encoded data, not encrypted. I'm curious about what I put here. Next I started to crack this code. The Code is as follows:
Copy codeThe Code is as follows:
Viewstate is saved in the page. savepagestatetopersistencemedium method. When sending back, the viewstate is restored in the page. loadpagestatefrompersistancemedium method. This is an article I am reading the translation of "wooye Hu ".ArticleWe can save it to the session. The Code is as follows:
Copy codeThe Code is as follows:
Protected losformatter = new losformatter ();
Protected override object loadpagestatefrompersistencemedium ()
{
String key = request. rawurl + "_ viewstate ";
If (session [Key]! = NULL)
{
System. Io. memorystream stream = (system. Io. memorystream) session [Key];
Stream. Seek (0, system. Io. seekorigin. Begin );
Return losformatter. deserialize (Stream );
}
Return NULL;
}
Protected override void savepagestatetopersistencemedium (Object viewstate)
{
String key = request. rawurl + "_ viewstate ";
System. Io. memorystream stream = new system. Io. memorystream ();
Losformatter. serialize (stream, viewstate );
Stream. Flush ();
Session [Key] = stream;
}
Now let's look at the current viewstate:
Copy codeThe Code is as follows:
<Input type = "hidden" name = "_ eventtarget" id = "_ eventtarget" value = ""/>
<Input type = "hidden" name = "_ eventargument" id = "_ eventargument" value = ""/>
<Input type = "hidden" name = "_ viewstate" id = "_ viewstate" value = ""/>
In this step, we implement the functions we need to use to remove viewstate and keep the original page in use.
From: http://www.itxuexi.com/tech/wangluobiancheng/dotnet/384501255272077.html