0.1.0 • Published 11 years ago

ms-viewstate v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
11 years ago

ms-viewstate

Utility functions for working with VIEWSTATE and EVENTVALIDATION hashes in ASP.NET-generated HTML markup. See Understanding ASP.NET View State for why Microsoft uses these.

Usage

extractVs(html)

Extract VIEWSTATE hash from markup. Returns null if no hash is found.

extractEv(html)

Extract EVENTVALIDATION hash from markup. Returns null if no hash is found.

replaceVs(html, replacement)

Replace VIEWSTATE hash in markup. Returns unmodified input if no hash is found.

replaceEv(html, replacement)

Replace EVENTVALIDATION hash in markup. Returns unmodified input if no hash is found.

scrub(html, optionalScrub)

Scrub VIEWSTATE and EVENTVALIDATION hashes in markup with the default [scrubbed] or optional second parameter if given.

License

Licensed under an MIT license.