Redirect during Async Postback causing an error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Norm

    #1

    Redirect during Async Postback causing an error

    The error that pops up in a JS alert box is:

    Sys.WebForms.Pa geRequestManage rParserErrorExc eption: The message from
    the server could not be parsed. ... "<DOCTYPE ..."

    I have three update panels and a couple of AJAX toolkit extenders on
    the page. The button that causes the problem is simply sending an
    email then redirecting to a "Thank You" page. There are two update
    panels that are both set to conditionally trigger on that button
    click. The reason for these update panels is multiple validation
    groups that need to be validated. When I Googled this problem, all I
    got was that Response.Redire ct() is suppossed to work, but it doesn't.
    I am using .NET 3.5.

    Thanks in advance for any help.
    Norm

    P.S. I might be missing something stupid, I've been up for a long time.
  • Norm

    #2
    Re: Redirect during Async Postback causing an error

    On May 2, 8:19 am, Norm <neon...@gmail. comwrote:
    The error that pops up in a JS alert box is:
    >
    Sys.WebForms.Pa geRequestManage rParserErrorExc eption: The message from
    the server could not be parsed. ... "<DOCTYPE ..."
    >
    I have three update panels and a couple of AJAX toolkit extenders on
    the page. The button that causes the problem is simply sending an
    email then redirecting to a "Thank You" page. There are two update
    panels that are both set to conditionally trigger on that button
    click. The reason for these update panels is multiple validation
    groups that need to be validated. When I Googled this problem, all I
    got was that Response.Redire ct() is suppossed to work, but it doesn't.
    I am using .NET 3.5.
    >
    Thanks in advance for any help.
    Norm
    >
    P.S. I might be missing something stupid, I've been up for a long time.
    I ended up doing it on the client. The was my solution: (slash
    workaround)

    ScriptManager.R egisterClientSc riptBlock(Me, GetType(Object) ,
    "redirect", "window.locatio n.href='Request Submit.aspx'", True)

    Happy coding!

    Comment

    • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

      #3
      RE: Redirect during Async Postback causing an error

      generally you can not do a response redirect from an async postback. the ajax
      call wants to parse the reponse to decide what to do. unless the page your
      code redirects knows what type of response to build and send back (no builtin
      support for this), the client side gets this error.

      the most common solution is redirecting from an async postback is to use
      ScriptManager.R egisterStartupS cript to render javascript that does the
      redirect (document.locat ion.href)


      -- bruce (sqlwork.com)


      "Norm" wrote:
      The error that pops up in a JS alert box is:
      >
      Sys.WebForms.Pa geRequestManage rParserErrorExc eption: The message from
      the server could not be parsed. ... "<DOCTYPE ..."
      >
      I have three update panels and a couple of AJAX toolkit extenders on
      the page. The button that causes the problem is simply sending an
      email then redirecting to a "Thank You" page. There are two update
      panels that are both set to conditionally trigger on that button
      click. The reason for these update panels is multiple validation
      groups that need to be validated. When I Googled this problem, all I
      got was that Response.Redire ct() is suppossed to work, but it doesn't.
      I am using .NET 3.5.
      >
      Thanks in advance for any help.
      Norm
      >
      P.S. I might be missing something stupid, I've been up for a long time.
      >

      Comment

      Working...