njsokalski
Well-known member
- Joined
- Mar 16, 2011
- Messages
- 102
- Programming Experience
- 5-10
I have an application that uses the WebMethod feature of ASP.NET. My JavaScript loks like the following:
function Solve(data){PageMethods.Solve(data,SolveSuccess,SolveFail);}
function SolveSuccess(result){window.alert(result);}
function SolveFail(error){}
This works fine, and displays the result in an alert just as I would expect. However, the place where I want to use result is outside of the Solve method. I have tried to change the SolveSuccess code to assign result to another variable declared outside of SolveSuccess, such as tempresult=result;, but then when I try to access tempresult it tells me undefined. Does anybody know of a way that I can make the result parameter available outside of SolveSuccess? Any help would be appreciated. Thanks.
--
Nathan Sokalski
function Solve(data){PageMethods.Solve(data,SolveSuccess,SolveFail);}
function SolveSuccess(result){window.alert(result);}
function SolveFail(error){}
This works fine, and displays the result in an alert just as I would expect. However, the place where I want to use result is outside of the Solve method. I have tried to change the SolveSuccess code to assign result to another variable declared outside of SolveSuccess, such as tempresult=result;, but then when I try to access tempresult it tells me undefined. Does anybody know of a way that I can make the result parameter available outside of SolveSuccess? Any help would be appreciated. Thanks.
--
Nathan Sokalski