Problems with accessing Asp.net through Cisco webvpn

Source: Internet
Author: User
A few days ago, the training system reported two bugs, both of which were caused by webvpn access over the Internet. There was no problem with access over the Intranet. The problem is described as follows:
  1. Errors are reported on pages with magicajax, indicating that/ajaxcallobject. JS is not found.
  2. A bunch of icag strings appear on the exam page.

The first problem is that I think the path used is incorrect. So I searched for the generated HTML Dode and found that the connection was changed, but it can still be accessed, as a result, I tried to forcibly introduce this JS file. The problem persists. I copied the content of this JS file to the webpage. the problem persists. Put it down first and it is just a pop-up box, it does not affect the use of users, but it is just a little less elegant.

The second problem is to check what icag is. After comparing it with the HTML code generated during Intranet access, it is found that the segment before viewstate is final. The pile of icag is what is in viewstate.

Therefore, I think webvpn is somewhat biased towards viewstate, so I want to replace viewstate. How can I replace it?
I suddenly thought of the previous Article compressing viewstate, so a bit of Baidu found
The program is as follows: # region compresses viewstate

Protected override void savepagestatetopersistencemedium (Object pviewstate)
{
Losformatter mformat = new losformatter ();
Stringwriter mwriter = new stringwriter ();

Mformat. serialize (mwriter, pviewstate );
String mviewstatestr = mwriter. tostring ();

Byte [] pbytes = system. Convert. frombase64string (mviewstatestr );

Pbytes = compress (pbytes );

String vstatestr = system. Convert. tobase64string (pbytes );

Registerhiddenfield ("_ mspvstate", vstatestr );
}

Protected override object loadpagestatefrompersistencemedium ()
{
String vstate = This. Request. Form. Get ("_ mspvstate ");

Byte [] pbytes = system. Convert. frombase64string (vstate );

Pbytes = decompress (pbytes );

Losformatter mformat = new losformatter ();

Return mformat. deserialize (system. Convert. tobase64string (pbytes ));
}

Public static byte [] compress (byte [] pbytes)
{
Memorystream mmemory = new memorystream ();

Deflater mdeflater = new Deflater (icsharpcode. sharpziplib. Zip. Compression. Deflater. best_compression );
Icsharpcode. sharpziplib. Zip. Compression. Streams. deflateroutputstream mstream = new icsharpcode. sharpziplib. Zip. Compression. Streams. deflateroutputstream (mmemory, mdeflater, 131072 );

Mstream. Write (pbytes, 0, pbytes. Length );
Mstream. Close ();

Return mmemory. toarray ();
}

Public static byte [] decompress (byte [] pbytes)
{
Icsharpcode. sharpziplib. Zip. Compression. Streams. inflaterinputstream mstream = new icsharpcode. sharpziplib. Zip. Compression. Streams. inflaterinputstream (New memorystream (pbytes ));

Memorystream mmemory = new memorystream ();
Int32 msize;

Byte [] mwritedata = new byte [4096];

While (true)
{
Msize = mstream. Read (mwritedata, 0, mwritedata. Length );
If (msize> 0)
{
Mmemory. Write (mwritedata, 0, msize );
}
Else
{
Break;
}
}

Mstream. Close ();
Return mmemory. toarray ();
}

# Endregion

Run. The problem is solved successfully.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.