[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

Regarding update panel

Hi sir, this is venu manne .if i use update panel response .write() is not working in any browser so can u plz give any alternative for this problem ..hope quick reply from u its little bit urgent  

thanks in advance
venu manne
0
mannevenu
Asked:
mannevenu
1 Solution
 
objectsCommented:
not sure I understand. can you post the code that is causing propblems
0
 
souvik2008Commented:
Please post the code which is causing you problem..
0
 
mannevenuAuthor Commented:
YA SURE
i am sending u the code which causing me problem
tihs code is for sneding page to excel becz of update panel it is showing parser error
 public static void Convert1(DataSet ds, HttpResponse Response)
    {
        
        Response.Clear();
        Response.AddHeader("content-disposition", "attachment; filename=mp1.xls");
        Response.Charset = "";
        //Response.ContentType = "application/vnd.ms-excel";
        System.IO.StringWriter stringWrite = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter htmlWrite = new System.Web.UI.HtmlTextWriter(stringWrite);
        System.Web.UI.WebControls.DataGrid dg = new System.Web.UI.WebControls.DataGrid();
        dg.DataSource = ds.Tables[0];
        dg.DataBind();
        dg.RenderControl(htmlWrite);
        Response.Write(stringWrite.ToString());
        Response.End();
 
    }

Open in new window

0
 
havj123Commented:
If ur datagrid is in the updatepanel, then it create problem. Lets do one thing, take a label outside updatepanel and try to write that text u use in Response.Write. Is it working?
0
 
mannevenuAuthor Commented:
hi i cont get ur solution .By searching i found one solution with this solution it is working first time later it is showing error as already used... i wil post both code and error plz go through and giv me solution

little bit urgent
thanks venu
<Triggers>
    <asp:PostBackTrigger ControlID="btnExcelReport" />
</Triggers>
 
error:
if you are trying to open the file from your list of most recently used files on the file menu,make sure that the file has not been renamed,moved,or deleted

Open in new window

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now