S
saturday
I've tried figuring this out as best I could, but I've already spent a
day trying to get this to work, and it's blocking further dev.
I have a page that is using master pages. I have a button in the
content page, but it refuses to execute its OnClick code.
I'll paste in the relevant code in question below. I suspect it has
something to do with master pages, but I'm not sure. I've created test
pages using sample code from MSDN that does not use master pages, and
the events work flawlessly. Oh yeah, and any "EnableViewState"
commands you see were added in by me. I got desperate and started
throwing them in several places, but they had no effect. For the
page_load, I've had it check for postbacks (when I still had my
repeater), but that had no effect either.
The aspx page:
<%@ Page Language="C#" MasterPageFile="~/Master.master"
AutoEventWireup="true" CodeFile="Page.aspx.cs" Inherits="Page"
Title="Untitled Page"%>
<asp:Content ID="Content1" ContentPlaceHolderID="Header"
Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server"
EnableViewState="true">
<asp:MultiView ID="MultiView" runat="server" EnableViewState="true">
<asp:View ID="View1" runat="server">
<asp:ImageButton ID="ImageButtonContinue" runat="server"
AlternateText="Continue" OnClick="ImageButtonContinue_Click"/>
<asp:LinkButton ID="LinkButton1" runat="server"
PostBackUrl="Default.aspx">LinkButton</asp:LinkButton></asp:View>
<asp:View ID="Login" runat="server">
</asp:View>
</asp:MultiView>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Footer"
Runat="Server">
</asp:Content>
The CS code behind:
protected void Page_Load(object sender, EventArgs e)
{
this.MultiView.SetActiveView(this.View1);
}
protected void ImageButtonContinue_Click1(object sender,
ImageClickEventArgs e)
{
Response.Redirect("Default.aspx"); //Break point is here, but
it's not happening.
//And yes, it breaks fine elsewhere.
}
Any help would be appreciated.
day trying to get this to work, and it's blocking further dev.
I have a page that is using master pages. I have a button in the
content page, but it refuses to execute its OnClick code.
I'll paste in the relevant code in question below. I suspect it has
something to do with master pages, but I'm not sure. I've created test
pages using sample code from MSDN that does not use master pages, and
the events work flawlessly. Oh yeah, and any "EnableViewState"
commands you see were added in by me. I got desperate and started
throwing them in several places, but they had no effect. For the
page_load, I've had it check for postbacks (when I still had my
repeater), but that had no effect either.
The aspx page:
<%@ Page Language="C#" MasterPageFile="~/Master.master"
AutoEventWireup="true" CodeFile="Page.aspx.cs" Inherits="Page"
Title="Untitled Page"%>
<asp:Content ID="Content1" ContentPlaceHolderID="Header"
Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" Runat="Server"
EnableViewState="true">
<asp:MultiView ID="MultiView" runat="server" EnableViewState="true">
<asp:View ID="View1" runat="server">
<asp:ImageButton ID="ImageButtonContinue" runat="server"
AlternateText="Continue" OnClick="ImageButtonContinue_Click"/>
<asp:LinkButton ID="LinkButton1" runat="server"
PostBackUrl="Default.aspx">LinkButton</asp:LinkButton></asp:View>
<asp:View ID="Login" runat="server">
</asp:View>
</asp:MultiView>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Footer"
Runat="Server">
</asp:Content>
The CS code behind:
protected void Page_Load(object sender, EventArgs e)
{
this.MultiView.SetActiveView(this.View1);
}
protected void ImageButtonContinue_Click1(object sender,
ImageClickEventArgs e)
{
Response.Redirect("Default.aspx"); //Break point is here, but
it's not happening.
//And yes, it breaks fine elsewhere.
}
Any help would be appreciated.