New Method for Response.Redirect?

Nov 10, 2009 at 4:39 AM

I've got an Iframe app that before I had to pass a session key and what not to the URL to do a redirect properly.

Doesn't work anymore with the 3.0 update, just wondering if there is a quick howto on doing redirects within an Iframe app?

Nov 10, 2009 at 4:58 AM

Here's the code that used to work:

Response.Redirect(String.Format("{0}?fb_sig_session_key=" + this.Api.Session.SessionKey + "&fb_sig_user=" + Uid.ToString(),Url),true);

 

Now it throws an exception on the constructor for CanvasIFrameBasePage:

[ArgumentNullException: Value cannot be null.
Parameter name: String]
   System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +10162393
   System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt) +210
   Facebook.Session.CanvasSession.LoadFromRequest() +1827
   Facebook.Session.CanvasSession..ctor(String appKey, String appSecret, List`1 permissions, Boolean readRequest) +287
   Facebook.Session.CanvasSession..ctor(String appKey, String appSecret, Boolean readRequest) +78
   Facebook.Session.CanvasSession..ctor(String appKey, String appSecret) +64
   Facebook.Session.IFrameCanvasSession..ctor(String appKey, String appSecret) +61
   Facebook.Web.CanvasIFrameBasePage..ctor() +76

Nov 10, 2009 at 4:18 PM

I think this is the culprit, looks like you have to also pass the Expiry time as well.  It would be nice if all of this happened automatically when I need to do a re-direct.

DateHelper.ConvertUnixTimeToDateTime(long.Parse(HttpContext.Current.Request[QueryParameters.Expires])));

Nov 11, 2009 at 2:49 AM
Matt, can you post your full redirect for us newbies? Thanks.
Nov 11, 2009 at 2:56 AM

As soon as I get something that works most certainly.  Right now I'm getting wierd 404 errors when trying to re-direct.

IE Can't find /AppRoot/~/Folder/SomePage.aspx

The fact that it's not properly redirecting to relative paths is a bit disconcerting.

Nov 11, 2009 at 4:18 AM

Well until I hear something from someone who knows how it's supposed to work, I'm rolling back.  I can't make it work anyway that I try.