Solved

Click Events Don't Work After LinkButton Postbackurl

Posted on 2013-12-14
4
283 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
Comment Utility
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
Comment Utility
It's the controls on the web page that are not firing not excel.
0
 

Accepted Solution

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

Author Closing Comment

by:whiwex
Comment Utility
I figured it out
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
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…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

8 Experts available now in Live!

Get 1:1 Help Now