the tamper code you are copying is for preventing code from altering a parameter (not web request). in old c# its:
public MyParameter()
{
private string _value;
public MyParameter(string value)
{
_value = value;
}
public string Value
{
get { return _value; }
}
}
so if you create a variable param:
var param = new MyParameter("hello");
the param.Value can not be changed.
I suspect because this is an asp.net forum, you asked the user tampering with a route or post back value. first never assume the user has not tampered. so check that the value is one the user is allowed. that is is it is know set of values, its in the set. if it is a key, then it should be encrypted.