Button On Click event not firing
the on click event works in other pages though.
here's the header of the page i'm trying to get it to work:
<%@ Page Title="Report" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Report.aspx.cs" Inherits="Report" %>
<%@ PreviousPageType VirtualPath="~/Default.aspx">
and the code behind:
protected void Page_Load(object sender, EventArgs e)
{
if (PreviousPage == null)
{
Res开发者_JAVA百科ponse.Redirect("~/Default.aspx");
}
// code..
when i click on it, it just redirects me to the PreviousPage. it also doesn't stop even when it has a breakpoint inside.
protected void export_Click(object sender, EventArgs e)
{
//code
}
In your Page Load, try using:
if(!Page.IsPostBack)
{
if (PreviousPage == null)
{
Response.Redirect("~/Default.aspx");
}
}
My answer is more about hints.
Have you created in code Behind method to handle the click?
Something like ButtonConfirm_Click(EventArgs e...
精彩评论