How can I pass the variable to c# function?. Suppose that:
<script>
var myValue;
function setValue(idriga) {
myValue = idriga;
}
function getValue() {
return myValue;
}
</script>
This is a script that set and get value. How can i pass the myValue value to a c# function code behind without calling aspx page and passing parameters but passing from aspx to aspx.cs and the from aspx.cs to aspx to show value returned from c# method (example search value into db and return other value?)
My function c# is:
protected string SearchUserByGuid(Guid area) {
return (from us in contextDB.AREAS
where us.ID_AREAS == area
select us.USER_NAME).Single();
}
webmethod,GenericHandlersetc as said @Roy