Skip to content

Infragistics Community Forum / Cross Platform / Ultimate UI for Xamarin / server cannot set content type after http headers have been sent

server cannot set content type after http headers have been sent

New Discussion
John
John asked on May 28, 2009 2:25 PM

I'm trying a sample from Infragistics 3.0 (.NET 2.0) to export an UltraWebGrid to Excel formal.

But the bowser says "server cannot set content type after http headers have been sent".

code:

<%@ Page Language="C#" MasterPageFile="~/MasterPages/Head.master" AutoEventWireup="true" CodeFile="DBViewer.aspx.cs" Inherits="Viewers_DBViewer" %>

<asp:Content ID="contentHeader" ContentPlaceHolderID="HeaderPlaceHolder1" runat="server">
    …//javascripts
</asp:Content>
<asp:Content ID="content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    …
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            …
            <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">Excel</asp:LinkButton>
            …
            <obln:inhUltraWebGridDatabase id="UltraWebGrid1" runat="server" OnInitializeLayout="UltraWebGrid1_InitializeLayout" OnInitializeRow="UltraWebGrid1_InitializeRow" ImageDirectory="/ig_common/Images/">
                …
            </obln:inhUltraWebGridDatabase>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="txtSearch" EventName="TextChanged"/>
        </Triggers>
    </asp:UpdatePanel>
    …
    <igxl:UltraWebGridExcelExporter ID="UltraWebGridExcelExporter1" runat="server"
        OnInitializeRow="UltraWebGridExcelExporter1_InitializeRow" OnBeginExport="UltraWebGridExcelExporter1_BeginExport">
    </igxl:UltraWebGridExcelExporter>
</asp:Content>

What can I do in this case?

Sign In to post a reply

Replies

  • 0
    [Infragistics] Vince McDonald
    [Infragistics] Vince McDonald answered on May 7, 2009 8:01 PM

    You likely need to trigger a normal postback with whatever control (likely your LinkButton1 instance) that you're using to cause the export.

    I provide additional details in the following forum thread:
    http://forums.infragistics.com/forums/t/2001.aspx

    • 0
      John
      John answered on May 28, 2009 2:25 PM

      works4me:

      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                  <Triggers>
                      <asp:PostBackTrigger ControlID="LinkButton1" />
                  </Triggers>

                  <ContentTemplate>
                  <table>
                      <tbody>
                          <tr>
                              <td><asp:Label id="lblToolbar" runat="server"></asp:Label></td>
                              <td><asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">Excel</asp:LinkButton></td>
                          </tr>
                      </tbody>
                  </table>

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
John
Favorites
0
Replies
2
Created On
May 28, 2009
Last Post
16 years, 9 months ago

Suggested Discussions

Created by

Created on

May 28, 2009 2:25 PM

Last activity on

May 28, 2009 2:25 PM