Link to home
Start Free TrialLog in
Avatar of whiwex
whiwex

asked on

Click Events Don't Work After LinkButton Postbackurl

I have a page with a linkbutton that has it's postbackurl pointing to a page that opens a excel
spreadsheet. The spreadsheet works fine but none of the click events work after the spreadsheet is opened. Here's the code for the page tha opens the spreadsheet.

<%@ Page Title="" Language="VB" MasterPageFile="~/Master Pages/Sponsor Program.master" AutoEventWireup="false" CodeFile="Print Excel.aspx.vb" Inherits="Chairman_Sponsor_Program_Reports_Print_Excel" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
   
</asp:Content>

Here is the vb code behind

Partial Class Chairman_Sponsor_Program_Reports_Print_Excel
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'CType(Page.PreviousPage, MyPreviousPage).MyPublicMethod()
        Dim fileData() As Byte = System.IO.File.ReadAllBytes(Server.MapPath("~/temp/sponsorsexport.xls"))

        Response.Clear()
        Response.AddHeader("Content-Type", "application/vnd.ms-excel")
        Response.AddHeader("Content-Disposition", "attachment; filename=""sponsorsexport.xls""")
        Response.BinaryWrite(fileData)
        Response.Flush()
        Response.End()

    End Sub

End Class


Pleas Help
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

I think it is Excel's security feature which is disabling click and other features. Excel shows an "Enable" button under the toolbar which user has to click to enable all features.
Avatar of whiwex
whiwex

ASKER

It's the controls on the web page that are not firing not excel.
ASKER CERTIFIED SOLUTION
Avatar of whiwex
whiwex

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of whiwex

ASKER

I figured it out