Hi,
I was looking at this project and could not understand a part of the javascript.
There is an asmx file in the project called Authentication. It has a method
In the file ToolTip.aspx, that method is called as such:
My confusion stems from the fact that:
Cheers
I was looking at this project and could not understand a part of the javascript.
There is an asmx file in the project called Authentication. It has a method
IsLoggedIn
:[ScriptService]
[WebService(Namespace =
"http://tempuri.org/"
)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public
class
Authentication : WebService
{
[WebMethod]
public
bool
IsLoggedIn()
{
return
Context.User.Identity.IsAuthenticated;
}
}
In the file ToolTip.aspx, that method is called as such:
<telerik:RadCodeBlock runat=
"server"
ID=
"RadCodeBlock1"
>
<script type=
"text/javascript"
>
function
OnClientBeforeShow(sender, eventArgs)
{
Authentication.IsLoggedIn(successfulAuthCallback, failedAuthCallback, eventArgs);
}
function
successfulAuthCallback(isLoggedInResult,eventArgs) {
if
(isLoggedInResult !=
true
)
{
// reload the entire page so the Forms Auth will see that the cookie has expired and redirect to login
window.location.reload(
true
);
}
}
function
failedAuthCallback(result, eventArgs)
{
alert(
"Auth Callback failed: Reason -- "
+ result);
}
</script>
</telerik:RadCodeBlock>
My confusion stems from the fact that:
IsLoggedIn
has no formal parameters. However, it is being passed 3 parameters.- I cannot see where
successfulAuthCallback
is being passed 2 parameters. It has two parameters. But where are they being passed to it.
Cheers