Export to Excel from GV on a panel (modal popup extender)

Discussion in 'ASP .Net Building Controls' started by jonefer, May 16, 2008.

  1. jonefer

    jonefer Guest

    If I want to export an Excel from a gridview
    I normally use these two procedures... but I get a render error perhaps due
    to the fact that this particular gridview is on a panel triggered by a modal
    popup extender:

    What should I modify or add?

    'this line is to help the Export to Excel control
    Public Overloads Overrides Sub VerifyRenderingInServerForm(ByVal control As
    Control)
    End Sub


    Protected Sub cmdExcelExport_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles cmdExcelExport.Click
    Response.Clear()
    Response.AddHeader("content-disposition",
    "attachment;filename=FileName.xls")
    Response.Charset = ""
    Response.ContentType = "application/vnd.xls"
    Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter
    Dim htmlWrite As System.Web.UI.HtmlTextWriter = New
    HtmlTextWriter(stringWrite)
    gvActionList.RenderControl(htmlWrite)
    Response.Write(stringWrite.ToString)
    Response.End()

    End Sub
     
    jonefer, May 16, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Page

    AJAX: modal popup extender

    James Page, Sep 8, 2008, in forum: ASP .Net
    Replies:
    5
    Views:
    1,491
    Ram krishna
    Sep 24, 2008
  2. Jerry Qu
    Replies:
    0
    Views:
    380
    Jerry Qu
    Feb 20, 2009
  3. Jerry Qu

    modal popup extender in user control

    Jerry Qu, Feb 20, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    606
    Jerry Qu
    Feb 20, 2009
  4. Denyus
    Replies:
    0
    Views:
    7,673
    Denyus
    Mar 5, 2009
  5. jonefer

    Modal Popup Extender Dilema

    jonefer, Apr 18, 2008, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    213
    jonefer
    Apr 18, 2008
Loading...

Share This Page