You need to Register for free and Login to post a message in the forum.

Forum

Subject: asp.net ajax error exporting datagrid data to excel
Prev Next
You are not authorized to post a reply.

Author Messages
sandeepmovva
Nuke Newbie
Nuke Newbie
Posts:1

23 Apr 2008 10:12 AM  
 

Hi All,

         I have a module which has different panels in a control and a tabbed interface.Based on this selection panels are shown.I used "Supports partial Rendering" for this control.Everything worked fine with the ajax functionality i mean when i click on tabs the corresponding panels are displayed without refreshing.But i added a link in the panels called "export to excel" and wrote its functionality.I get an excel file if i uncheck the option "Supports partial Rendering".But when i check that option since i want the panels to be shown without page refresh i have checked the partial rendering functionality.When this is checked i get the following error.The following is the sample code i have written for the link.

    Protected Sub competencygridexport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles competencygridexport.Click

            Response.Clear()

            Response.AddHeader("content-disposition", "attachment;filename=myexcelfile.xls")
            Response.Charset = ""
            Response.Cache.SetCacheability(HttpCacheability.Public)
            Response.ContentType = "application /vnd.xls"


            Dim StringWriter As New StringWriter
            Dim htmlWrite As New HtmlTextWriter(StringWriter)
            htmlWrite.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Html)
            lstCompetencies.HeaderStyle.Font.Bold = True
            lstCompetencies.GridLines = GridLines.Both

            lstCompetencies.Columns(2).Visible = False
            lstCompetencies.Columns(3).Visible = False
            lstCompetencies.Columns(4).Visible = False

            lstCompetencies.AllowPaging = False
            lstCompetencies.AllowSorting = False

            'Render(htmlWrite)

            lstCompetencies.RenderControl(htmlWrite)
            htmlWrite.RenderEndTag()
            Response.Write(StringWriter)
            Response.End()
        End Sub

The error i get is a javascript popup which contains the following text in it.All the function executes fine and finally i get the javascriptpop up so i can say there is a pbm with this ajax stuff and not with my code since i am able to export it when the ajax functionality is disabled i mean "Supports partial rendering" is turned off.I think this is due to the line response.write in my code.What might be the problem and how to solve it.please help.

Sys.WebForms.PageRequestManagerParseErrorException: The message recieved from the server could not be parsed.Common causes for this error are when the response is modified by calls to Response.Write(),response filters,Http Modules, or server trace is enabled..so on.

Why is this occuring.please help.I really need the ajax functionality to be working but with this excel option i cannot.Its urgent.Thanks in advance.

Regards,

.netuser

You are not authorized to post a reply.
Forums > DotNetNuke® > Modules - What's needed? > asp.net ajax error exporting datagrid data to excel



ActiveForums 3.7

Latest Forum Posts

RE: New Logo cant display by jncraig
There is nothing wrong with this, provided that you did it correctly.  I would have to look at your ...
RE: Child portal to live site by jncraig
You should set DNS to point the URL to the IP address of the DotNetNuke installation.  Inside of the...
RE: PopUp Page by jncraig
To open a link in a new window, format the link this way:Link to us! It is the target="_blank" that...
RE: How to Change fckeditor alignment by jncraig
It might be easier to use a different skin for your administrative pages. There have been some ot...
RE: Can't Login! Login Page can't be accessed... by jncraig
If you have access to your database, look at the Portals table.  Make sure that LoginTabID is set to...
RE: Can't Login! Login Page can't be accessed... by e-kreator
Hello my problem is that the configuration management in login page page was sent to a Web page that...
RE: Create new 'host' user? by jncraig
You can change a regular user to a Host, by setting the "Host" user's IsSuperUser set to True in the...
Create new 'host' user? by jonathanbrickman0000
I have a DNN 4.7 web site successfully migrated to a new server.  There is only one hitch:  the 'hos...
RE: split copyrgt option in two lines by jncraig
You can put a in the copyright text. This may or may not put other text (to the right of the copyr...
RE: Can't Login! Login Page can't be accessed... by jncraig
Try: http://localhost/DNN/login.aspx http://localhost/DNN/?ctl=login If neither of those ge...
RE: HOw to upload site from localserver to www.mysite.com by jncraig
View this tutorial:How to transfer a localhost DotNetNuke installation to a live websitePay special ...
RE: Nightmare with SKINS... by jncraig
Before you get in too far, you might want to take a look at:An Introduction to the Principles of Dot...
RE: Nightmare with SKINS... by dougieladd
Hi Joe...thank you for that...I kind of assumed that was the case. As I understand it the skin comes...
HOw to upload site from localserver to www.mysite.com by aniket.rasal
Dear Friends,       I have created site. Its wolring fine on my local machine.But when i upload the ...
RE: DotNetNuke 4.9.1 and 5.0.0 by leesykes
It is on the Extensions page as well - named 'Batch Install Extensions' stefan blogged about it here...
How to Change fckeditor alignment by aniket.rasal
Hello Friends,       I am creating site with customized skin. In that i want to change the alignmen...
RE: DotNetNuke 4.9.1 and 5.0.0 by leesykes
Talk about hiding things - it took me a while even though it was staring me in the face!In the Contr...
RE: DotNetNuke 4.9.1 and 5.0.0 by leesykes
This post is worth a read in the main dnn forumsHaving upgraded, one thing that is confusing is wher...
RE: DotNetNuke 4.9.1 and 5.0.0 by leesykes
Hello, I've just been experimenting with this upgrading a fresh 4.6.2 (default installation no ex...
Can't Login! Login Page can't be accessed... by durationinc
Hi guys,I develop a website using DotNetNuke 4.9.1. I can't login after I did some modifications on ...
AppTheory
RSS Feeds