在ASP.NET中未执行Page_Load [英] Page_Load is not executed in 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中,我有这个:
and in my asp I have this:
<%@ Page Title="VMP Online Booking" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ZumaApp._Default" %>
我的问题
页面加载功能未执行.
My problem
The page load function is not executing.
首先:我在Page_Load函数的第一行上创建了一个断点,但是Visual Studio并没有在该断点处停止.
First: I make a break point on the first line in the Page_Load function, but visual studio doesn't stop at the break point.
第二秒:我在此行上创建一个断点 public String CallerId =";
,Visual Studio在该行上停止,然后按 step over
,但该页面无需进入Page_Load函数即可加载.
second: I make a break point at this line public String CallerId = "";
and Visual studio stops on that line, then I press step over
but the page loaded without going to the Page_Load function.
我尝试清理并重建,但没有帮助
I tried clean and rebuild but dones't help
推荐答案
尝试删除 .Designer.cs
,然后通过转换为Web应用程序"选项重新创建.
Try delete the .Designer.cs
and recreate it by Convert to web application option.
可以通过右键单击 aspx/ascx
文件并选择转换为Web应用程序"选项来重新生成它.
It can be regenerated by right clicking on the aspx / ascx
file and select Convert to web application option.
有时VS不会刷新 .Designer.cs
,因此需要应用此方法来获取新的 .Designer.cs
文件.
Some times .Designer.cs
wont be refreshed by VS, and need to apply this method to get a fresh .Designer.cs
file.
这篇关于在ASP.NET中未执行Page_Load的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!