I have an updatepanel which after clicking one button is submitting the page. The code is
<asp:ScriptManager ID="MainScriptManager" runat="server" EnablePageMethods="true" />
<asp:UpdatePanel ID="pnlCalendar" runat="server">
<ContentTemplate>
<asp:PlaceHolder ID="panCalendarHolder" runat="server"></asp:PlaceHolder>
<br /><br />
<asp:Button id="btnViewWholeWeek" text="View Whole Week" runat="server" CssClass="normal-button" OnClick="viewWholeWeek" CausesValidation="false"></asp:Button>
</ContentTemplate>
</asp:UpdatePanel>
the function on press contains no code as I’ve been testing with out that to see if it was causing the problem. Here is it anyway
protected void viewWholeWeek(object sender, EventArgs e) {
HtmlContainerControl paraDayName = (HtmlContainerControl)new HtmlGenericControl("p");
paraDayName.InnerHtml = "test";
panCalendarHolder.Controls.Add(paraDayName);
}
I press the button above once… it works – refreshing the updatepanel. I press it again and it submits the page. I have everything inside a <form id="frmMain" runat="server"> and </form> tag….
any ideas?!
I tried your code, there is no problem in there at all… maybe you give us more details! What do you do in Page_load function?