Hello,
IE Functionality of Exporting tables to Microsoft Excel doesn't work properly when used with Asp.NET AJAX,
it always exports the first loaded data ignoring any updates done through AJAX Asynchronous post back
i.e. if a page is loaded with data X and then updated using AJAX update panel and
returned data Y then using Export to Microsoft Excel on this page will export
the first data X and not data Y
how can this be fixed?
Appreciate your help in advance.
maybe you can put some code here so that we can know what actually happen.
currently it work fine to me
Hello,
This is a sample of the code unfortunately i wanted to upload the solution but was not able to add files.
I have a master page, default.aspx and dataclass.cs
Appreciate your help in advance.
"C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
"Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> "ScriptManager1" runat="server">
"DropDownList1" runat="server" AutoPostBack="True"> A B"UpdatePanel1" runat="server"> "GridView1" runat="server" DataSourceID="ObjectDataSource1"> "ObjectDataSource1" runat="server" TypeName="DataClass" SelectMethod="FillData"> "DropDownList1" Name="text" PropertyName="SelectedValue" Type="String">
using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partialclass _Default : System.Web.UI.Page {protected void Page_Load(object sender, EventArgs e){if(!IsPostBack)DropDownList1.SelectedIndex = 1;}}public class DataClass{public DataClass(){//// TODO: Add constructor logic here//}public static DataTable FillData(string text){DataTable dt =new DataTable();dt.Columns.Add("Column");for (int i = 0; i < 100; i++){dt.Rows.Add(new object[] { text });}return dt;}}
No comments:
Post a Comment