• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Andy Miller
#1 Posted : Thursday, November 30, 2006 8:40:55 PM(UTC)
Andy Miller

Rank: Member

Joined: 11/5/2003(UTC)
Posts: 2,136

Was thanked: 1 time(s) in 1 post(s)
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.AddscriptForClientSideEval("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.
Andy Miller
Structured Solutions

Shipper 3 - High Velocity Shipment Processing
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012