Utility functions for working with VIEWSTATE and EVENTVALIDATION hashes in ASP.NET-generated HTML markup.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
README.md
component.json
package.json

README.md

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.