Yes. I've gone through all the similar questions here and at SO. Yes, and all the Google links.
No, there's no javascript or other client side things going on.
No, there's no update panel.
But the Button does not fire the Click event unless the page has already been submitted once. Not even that the Submit button has been pushed...even the Cancel button, which does nothing but reload the page, makes the Submit button work.
All possible combinations of the UseSubmitBehavior and CausesValidation properties have been tried.
I'm looking for an abnormal cause, not an often-seen one.
I even created a new page. stripped everything down to barebones do-nothing and it STILL doesn't work.
Here's the ASPX code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Questions</title>
<link rel="stylesheet" type="text/css" href="PatientRounding.css" /></head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblCount" runat="server" Text=" responses added"></asp:Label>
</div>
<asp:Panel runat="server" id="divQuestions" CssClass="MainDiv" >
</asp:Panel>
<div>
<asp:Button ID="btnQuit" runat="server" CssClass="PageButton" OnClick="btnQuit_Click" Text="Return to Start" />
<asp:Button ID="btnCancel" runat="server" CssClass="PageButton" OnClick="btnCancel_Click" Text="Clear Answers" />
<asp:Button ID="btnSubmit" runat="server" CssClass="PageButton" OnClick="btnSubmit_Click" Text="Submit Answers" />
</div>
</form>
</body>
</html>
Here's the aspx.cs code:
public partial class PatientQuestions : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Page_PreInit(object sender, EventArgs e)
{
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
lblCount.Text = "Done";
}
protected void btnCancel_Click(object sender, EventArgs e)
{
}
protected void btnQuit_Click(object sender, EventArgs e)
{
Server.Transfer("Default.aspx", false);
}
}
What am I not seeing? Why do I have to reload the page before the code behind code works?
This happens whether I'm running on my desktop with IISExpress from within VS, or out on the web server.
What could possibly cause this?