Solved

Click Events Don't Work After LinkButton Postbackurl

Posted on 2013-12-14
4
286 Views
Last Modified: 2013-12-22
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
0
Comment
Question by:whiwex
  • 3
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39720256
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.
0
 

Author Comment

by:whiwex
ID: 39720264
It's the controls on the web page that are not firing not excel.
0
 

Accepted Solution

by:
whiwex earned 0 total points
ID: 39724109
I fixed this by using navagateurl instead of postbackurl.
0
 

Author Closing Comment

by:whiwex
ID: 39734437
I figured it out
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now