Tuesday, October 27, 2009

Asp.net Ajax Gotchas

Today I took a foray into asp.net's Ajax controls.
Mostly it was incredibly simple, however given Microsoft's penchant for surprises, I managed to 2 surprises.
I'm using Ajax to pull back a fresh copy of the session variables and display them in an
    on the sidebar.
    • Generating  an Ajax partial postback clientside
      • Some web pages will advocate __doPostBack('UpdatePanel1','');
        • This breaks if you have eventValidation on
        • Turn off event Validation at the risk of security is my guess?
      • Some web pages will advocate using a hidden button and using javascript to trigger it
        • This was the approach I got to function without an exception
    • Response.Write is not allowed in an Ajax partial update
      • <%= %> seems to have partially worked, but I think it's stripping my html tags

No comments:

Post a Comment