Click here to Skip to main content
15,887,386 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have .Net Function In Code Behind
//.Net Function 
public int Test()
{
//Do Something
return 0;
}
//Call In JavaScript Like This
var Ret = '<%=Test()%>'

I Want To Call Function With ref parameter
//.Net Function 
public int Test(ref int ret)
{
ret = value;
//Do Something
return 0;
}

How To Pass ref Parameter
Posted
Updated 22-Apr-12 23:07pm
v2

1 solution

Ref means you want to maintain the change. What you are trying is not possible as far I know. You are trying to call a server method from JavaScript - that would a stateless call. You cannot maintain an object this way. I am not sure why are you trying to do such stuff but there can be other ways like using XMLHttpRequest to send the data and get back what you want on client side.

I would suggest using XMLHTTPRequest here for calling a server method and getting back data: XMLHttpRequest[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900