Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
The solution has been found:

The web pages use a Master, if that matters.

Apparently, it does matter, if the MasterPage in question (mandated from above) contains a form of its own. Sheesh.

Despite the instructions below which say Let's work to help developers, not make them feel stupid, some things just cry out for slapping the developer in the face a few times. Repeat after me: ASP.NET doesn't like it if there are two Forms on the page.*

*Well, yes, you can. But they can't be nested, and only one can have the "runat=server" set.

[Question left intact in case anyone else finds themselves in the same situation.]

Anyway, NONE of my events fire.

If I drop a Button on the page, I can double-click it and it will create the Button_Click skeleton in the .cs file, no problem.

I can go into the .cs file and have intellisense let me pick the Buttons (or whatever) from the corresponding .aspx page, so they seem to be connected to each other. The Designer page has all the correct declarations, too.

But at run time (local debug), the events never get fired no matter how hard I click the buttons. Or drop the dropdowns. Or whatever.

Here's the top of the aspx page:

<%@ Page Title="" Language="C#" MasterPageFile="~/OPPE.Master" AutoEventWireup="true" CodeBehind="Focused_Reviews.aspx.cs" Inherits="OPPE.AcuteMedClinicians.Focused_Reviews" %>


and here's the code behind:

namespace OPPE.AcuteMedClinicians
{
  public partial class Focused_Reviews : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
etc...


Anything obvious I'm missing? Do those subdirs need some sort of magic done to them? Is it just the local debug cassini can't handle anything but a straightforward namespace, but IIS will (haven't tried deploying yet)?

No joy in Mudville this afternoon.
Posted
Updated 3-Jun-11 9:27am
v4

0) Combo boxes need AutoPostBack="true"

1) I have AutoEventWireup set to "false", and my button events fire just fine.
 
Share this answer
 
Comments
GenJerDan 3-Jun-11 14:54pm    
True or False, made no difference. AutoPostBack is set on the combos. It's acting like it's not a web app. Yes, I even tried running "Convert to Web Application" on the project. No diff. "Normal" HTML controls work just fine, i.e. a hyperlink will bring me to a new page. Driving me crazy.
GenJerDan 3-Jun-11 15:21pm    
Accepted because it is tacky to provide my own solution, even though it had nothing to do with either. Problem actually solved by Brian Eno and a cigarette.
#realJSOP 3-Jun-11 15:52pm    
Who do you think you are? McGyver? :) Post your solution as an answer.
Apparently, it does matter, if the MasterPage in question contains a form of its own. Sheesh.

Despite the instructions below which say Let's work to help developers, not make them feel stupid, some things just cry out for slapping the developer in the face a few times. Repeat after me: ASP.NET doesn't like it if there are two Forms on the page.*


*Well, yes, you can. But they can't be nested, and only one can have the "runat=server" set.

This one had a little search box in the top banner, with it's own form. I moved it above the "real" Form for the page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900