c# - Page_Load在asp.net中没有执行

标签 c# asp.net

我有这个c#代码

namespace ZumaApp
{

    public partial class _Default : System.Web.UI.Page
    {
        ServiceReference1.QSLWebBookingSoapClient services;
        public String CallerId = "";
        public Int32 rowCount;
        protected void Page_Load(object sender, EventArgs e)
        {
            CallerId = Request["CallerID"];

在我的 asp 中我有这个:

<%@ Page Title="VMP Online Booking" Language="C#" MasterPageFile="~/Site.master"
    AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ZumaApp._Default" %>

我的问题

页面加载函数没有执行。

我怎么知道的

首先:我在 Page_Load 函数的第一行打了一个断点,但 visual studio 并没有在断点处停止。

第二:我在这一行 public String CallerId = ""; 处打断点,然后 Visual Studio 停在该行,然后我按 step over 但是页面无需调用 Page_Load 函数即可加载。

我试过清理和重建但没有帮助

最佳答案

试试这个

<%@ Page Title="VMP Online Booking" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeBehind="_Default.aspx.cs" Inherits="ZumaApp._Default" %>

关于c# - Page_Load在asp.net中没有执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22558445/

相关文章:

c# - 在 asp.net webform 中检测移动版本 - c#

c# - 日志记录:使用 try finally block 来记录方法开始和结束是否可以接受?

C# 线程数

c# - MVVMCross ValueConverter Bool 到 MvxColor/Color

c# - 向成员表中添加列。但是无法访问它们? ASP.NET C#

c# - MVVM 在两个 View / View 模型之间传递数据

asp.net - 如何在注销时重定向到默认页面

c# - ListView - 从所选项目中获取列值

c# - 如何确定给定日期是否是该月的第 N 个工作日?

c# - 正确部署了Azure中的所有文件,但仍然无法看到网页