Welcome Guest Search | Active Topics | Sign In | Register

CallbackPanel and Response Options
tommyleo
Posted: Monday, January 18, 2010 7:43:34 PM
Rank: Member
Groups: Member

Joined: 10/25/2009
Posts: 26
I get an error from the CallbackPanel!!!

This is the code!!

Code: HTML/ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="BackOffice.WebForm3" %>

<%@ Register assembly="EO.Web" namespace="EO.Web" tagprefix="eo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <eo:CallbackPanel ID="CallbackPanel1" runat="server" Height="150px" 
            Width="200px" Triggers="{ControlID:butExport;Parameter:}">
            <asp:Button ID="butExport" runat="server" Text="Export" 
                onclick="butExport_Click" />
        </eo:CallbackPanel>
    </form>
</body>
</html>


Code: C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BackOffice
{
    public partial class WebForm3 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void butExport_Click(object sender, EventArgs e)
        {
            string attachment = "attachment; filename=export.xls";
            Response.ClearContent();
            Response.AddHeader("content-disposition", attachment);
            Response.ContentType = "application/vnd.ms-excel";
            
            Response.Write("text excel");
            Response.Write("\t");
            Response.Write("\n");
            Response.End();
        }

    }
}
eo_support
Posted: Monday, January 18, 2010 7:51:29 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

That's normal. You can not touch the Response output at all when you do AJAX call. The only thing you can do is to with response is to call Redirect, in that case it goes to a totally different page.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.