Solved

Click Events Don't Work After LinkButton Postbackurl

Posted on 2013-12-14
4
303 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

627 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