[Dojo-interest] Re: Re: How to read the response from dojo bind

troyf troyf at adbeast.com
Tue Jan 2 13:20:20 MST 2007


Well, it would almost.  The other bit I didn't talk about is how I'm trying to check for a login page too.

I'm using the ASP.Net Membership api to manage authentication.  Once the session times out the page is redirected to login.aspx.  However, if the session times out and then the user triggers an async update via dojo.io.bind (and I have many of those) then IIS redirects the async call.

For example, say a user completes some fields in a dojo dialog and clicks save, the client-side script submits those values to a UI-less .aspx page for processing.  That page then returns a JSON string containing a success/failure status value and other relevent info such as an Id of a new record, or perhaps the text of an error string defined by me.

If the session had timed out before they click save then the async call is redirected to login.aspx.  Since some of my newer dialogs are actually loaded at runtime via setUrl their contents suddenly display part of the login page.  It's not pretty.

So I do need to be able to interpret the returned page.  If I can determine that it is the login page then I can react to it appropriatly.

One thought was to bury a JSON string at the top of the login page and try and look for it.  But that returns undefined too.  I suspect it is because the remainder of the page beyond the JSON can not be properly parsed.

t
"James Deakins" <tendrid at gmail.com> wrote in message news:a331c6370701021129m336ec61cn72d76040bfe05a06 at mail.gmail.com...
  A slightly less elegant way would be to define your error page in IIS to use JSON.  Then dump all the data to a DEBUG variable.  In every page, you can then simple print the variable.

  Would this type of avenue work for you?

  -Demo


------------------------------------------------------------------------------


  _______________________________________________
  Dojo FAQ: http://dojo.jot.com/FAQ
  Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
  Dojo-interest at dojotoolkit.org
  http://dojotoolkit.org/mailman/listinfo/dojo-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070102/9128bbeb/attachment.html


More information about the Dojo-interest mailing list