Run script returned from AjaxMethod

  1. #1

    Run script returned from AjaxMethod

    What's the best way to run scripts returned by an AjaxMethod? *Currently, I just do eval(result) but not sure if that's the recommended way. *Seems a little hacky to me. *
  2. #2

    RE: Run script returned from AjaxMethod

    Hi,

    I think you could call:

    myScriptManager.AddScript("alert('Script added!');");
    Best,

    Dirk Louwers
  3. #3

    RE: Run script returned from AjaxMethod

    Thanks for the code example, but I forgot to mention that I am running a static AjaxMethod so I do not have access to the ScriptManager.
  4. #4

    RE: Run script returned from AjaxMethod

    Hi jchau,

    I think the eval is fine. We use eval also when parsing AjaxEvent response.




Similar Threads

  1. Replies: 1
    Last Post: Jun 28, 2011, 10:38 PM
  2. Replies: 3
    Last Post: Jun 10, 2011, 3:23 PM
  3. Replies: 3
    Last Post: Mar 23, 2011, 5:38 PM
  4. Replies: 1
    Last Post: Sep 29, 2010, 2:12 AM
  5. Replies: 1
    Last Post: Oct 13, 2009, 3:34 AM

Posting Permissions