I am having problems with the asp.net web form that uses the homepage. The problem only occurs when the page is named default.aspx. With the name default.aspx, if there is any code in the Page_Load event, other events do not fire. This also includes all the code I commented on. I tested OnInit and button click events, the problem first appeared when I pressed buttons that didnโt work.
The default code is .aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/TWS/tws.Master" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="SITMComAU.TWS.original" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="bodyPlaceholder" runat="server"> </asp:Content>
OnInit Fires: - Checked arrow break point
public partial class original : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected override void OnInit(EventArgs e) { base.OnInit(e); int a = 1; int b = 2; int c = a; } }
OnInit does not work: - checked through break point
public partial class original : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected override void OnInit(EventArgs e) { base.OnInit(e); int a = 1; int b = 2; int c = a; } }
OnInit does not work: - checked through break point
public partial class original : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { int y = 5; int z = y - 1; } protected override void OnInit(EventArgs e) { base.OnInit(e); int a = 1; int b = 2; int c = a; } }
All of the above works if the aspx, cs and designer files are renamed to something other than the default value.
As for the main page. This is just a layout; there is no function in the .cs file.
What I tried:
- Restart Visual Studio
- Rebooting
- Removing dll, pdb files from bin
- Voodoo
- Hair extension
- Pulling other hair
I hope someone can help!
Jon p
source share