You have probably noticed that the Anthem story for using Response.Redirect in a callback is not very good. Basically, you have to use Anthem.Manager.Addscript
ForClientSideEval("window.
location = 'xxx';") which is quite tedious. The server side code often looks like:
Code:
If Anthem.Manager.IsCallBack Then
Anthem.Manager.Addscript[b][/b]ForClientSideEval("window.[b][/b]location = 'xxx';")
Else
Response.Redirect("xxx");
End If
The next version of Anthem (you can play with the snapshot now) has a much better story. Basically you can use Response.Redirect and Anthem will generate the appropriate javascript
for you. The only restriction is that you call Anthem.Manager.Register at some point
before you call Response.Redirect.
All of the admin pages inherit from BaseAdminPage which has a PreInit handler that checks a permission. If the check fails, the method will call Response.Redirect to display the login screen. If you add Anthem.Manager.Register(Me) before ValidateCurrentUserHasPermission, then if the check fails during a callback the browser will be correctly redirected. Without Anthem.Manager.Register the callback will silently fail and the page will not be redirected.
Note that this will only work with the latest Anthem snapshot or later, so I don't recommend making this change yet. I just did not want to forget.