I have a Reason to use the Evercookie, It works fine in HTML pages but i am unable to get its value from codebehind after a postback.
I have found a workaround by using a hidden field however it's always loses its value after a postback:
<input type="hidden" id="hfimageurl" name="hfimageurl" value="" />
<script>
var ec2 = new evercookie();
document.getElementById('hfimageurl').value = "User";
ec2.get("id", function (value) { if (value == '10') {
document.getElementById('hfimageurl').value = "BadUser"; }
});
ec2.get("id", function (value) { alert(value); });
</script>
In codebehind after a postback i always get val
= '' :
string val = Request.Form("hfimageurl");
if (val != "BadRequest") {
}
Please note that the alert shows the value correctly.
What do i missing here?