Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

Rate It (1)

Last post 11-10-2006 2:31 AM by jkey. 12 replies.

Sort Posts:

  • Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-24-2006, 12:14 PM
    • Member
      35 point Member
    • ivanchok
    • Member since 11-29-2005, 4:38 PM
    • La Paz, Bolivia
    • Posts 25

    Almost a year ago Nikhil Kothari claimed that Microsoft was working on addressing the following limitations (see http://forums.asp.net/thread/1150298.aspx):

    1.  Sometimes it is desirable to cause a full page postback from within a UpdatePanel.  This is desirable because not everything works inside an UpdatePanel.  (See http://forums.asp.net/thread/1301938.aspx and http://forums.asp.net/thread/1150298.aspx)
    2. It should be possible to issue a page redirect from within an UpdatePanel (see http://forums.asp.net/1150506/ShowPost.aspx)
    3. It should be possible to generate an Excel file from within an UpdatePanel (see http://forums.asp.net/thread/1282087.aspx and http://forums.asp.net/thread/1414231.aspx)

    Does anyone know what the status of these fixes is?

    Ivan 

  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-24-2006, 1:48 PM
    • Member
      519 point Member
    • AndresS
    • Member since 06-10-2002, 8:40 PM
    • Posts 108

    I think we fixed issue #1, and 2 see sample below. Office 12 has some API that you can plug in the event handler.

     

    <%@ Page Language="C#" %>

    <script runat="server">

    protected void Button1_Click(object sender, EventArgs e)

    {

    Response.Redirect("http://www.microsoft.com");

    }

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

    <title>Untitled Page</title>

    </head>

    <body>

    <form id="form1" runat="server">

    <div>

    <asp:ScriptManager ID="ScriptManager1" runat="server">

    </asp:ScriptManager>

    </div>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">

    <ContentTemplate>

    <asp:Button ID="Postback" runat="server" Text="Show Postback" />

    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Show Redirect" />

    </ContentTemplate>

    <Triggers>

    <asp:PostBackTrigger ControlID="Postback" />

    <asp:AsyncPostBackTrigger ControlID="Button1" />

    </Triggers>

    </asp:UpdatePanel>

    </form>

    </body>

    </html>

    AndresS


    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-24-2006, 3:50 PM
    • Member
      35 point Member
    • ivanchok
    • Member since 11-29-2005, 4:38 PM
    • La Paz, Bolivia
    • Posts 25

    Thank you, Andres.   We tried this and issues 1 and 2 are indeed resolved.  To add to the answer, the documentation actually makes reference to this:  http://ajax.asp.net/docs/tutorials/enhancing/updatepanelTriggerEditorDialog.aspx Embarrassed


    If anyone knows about how to solve issue number 3, we'll appreciate the feedback.

    Ivan
     

  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-24-2006, 4:00 PM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    i still think that the best option to #3 is to use a handler that returns that file since you still can't get the excel file from within a panel. 

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-24-2006, 8:51 PM
    • Member
      78 point Member
    • jkey
    • Member since 04-03-2006, 5:23 AM
    • Posts 32

    I was earlier using an excellent ajax framework, MagicAjax, for .net 1.1 that allowed me to add an attribute to controls that instructed the framework to override the ajax callback, see http://www.magicajax.net/site/docs/Usage.html#attributes. That is intuitive, as you do not always have easy access to ScriptManager from code (i.e. in user controls).

  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-25-2006, 6:57 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    getting a reference to the scriptmanager from a user control is as calling the GetCurrent static method of the class:

    ScriptManager manager = ScriptManager.GetCurrent( this.Page ); 

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-26-2006, 11:04 AM
    • Member
      20 point Member
    • Felipe Tx
    • Member since 10-26-2006, 3:00 PM
    • Posts 4
    AndresS:

    I think we fixed issue #1, and 2 see sample below. Office 12 has some API that you can plug in the event handler.

    protected void Button1_Click(object sender, EventArgs e)

    {

    Response.Redirect("http://www.microsoft.com");

    }

    This solution doesn’t work to me... I need some help with that.. Anyone?

     Thanks.

  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-26-2006, 11:04 AM
    • Member
      20 point Member
    • Felipe Tx
    • Member since 10-26-2006, 3:00 PM
    • Posts 4
    AndresS:

    I think we fixed issue #1, and 2 see sample below. Office 12 has some API that you can plug in the event handler.

    protected void Button1_Click(object sender, EventArgs e)

    {

    Response.Redirect("http://www.microsoft.com");

    }

    This solution doesn’t work to me... I need some help with that.. Anyone?

     Thanks.

  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-26-2006, 11:09 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    does that mean that you're not being redirected? 

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-26-2006, 3:21 PM
    • Member
      519 point Member
    • AndresS
    • Member since 06-10-2002, 8:40 PM
    • Posts 108
    This works in Asp.NET AJAX BETA 1. Are you running beta 1?
    AndresS


    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-27-2006, 9:41 AM
    • Member
      20 point Member
    • Felipe Tx
    • Member since 10-26-2006, 3:00 PM
    • Posts 4
    Luis Abreu:

    hello.

    does that mean that you're not being redirected? 

    True.

  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    10-27-2006, 11:06 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello again.

    that's weird since atlas has supported redirection for a long time. did you update web.config file to use the new release? 

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Unresolved issues: full page postback, redirection, generating Excel from within an UpdatePanel, etc.

    11-10-2006, 2:31 AM
    • Member
      78 point Member
    • jkey
    • Member since 04-03-2006, 5:23 AM
    • Posts 32

    Thank you, Luis!

    This just to confirm that by referencing ScriptManager, setting the

    manager.RegisterPostBackControl(YourButton) in code beside/behind

    allows you to circumvents the callback and cause an actual postback for (dynamically added) controls that do not support ajax, such as File Upload. At least in beta 2.

     

Page 1 of 1 (13 items)