I am using the following javascript to retrieve a value of a asp hidenfield.
var pagemode
function setValue() {
pagemode= document.getElementById('<%#litTest.ClientID%>').value;
}
function Item_load(sender, eventArgs) {
window.location.href = "Request.aspx?Request_ID=" + eventArgs.get_item().getMember('Request_ID').get_value() + "&ListType=" + pagemode;
}
The value to the hiddenfield is loaded in page load in code behind. I need to pass the value as a querystring and it comes as undefined.
I would really appreciate if anyone can help.
So you don’t get a reference to your hiddenfield? Try this:
Otherwise use the javascript debugger to inspect the order of executino and the variable values.