如果我使用System.Web.Ui命名空间

我有一个使用C#用ASP.Net Web Form 4.0编写的Web应用程序,生产机器是带有IIS 8.5.9600.16384的Windows Server 2012 R2。 和SQL Server 2014。

应用程序中的每个页面运行速度很快,但是使用命名空间system.web.Ui的任何页面在我第一次打开时花费将近2分钟,然后我可以快速打开任何页面而没有问题,如果没有人打开该页面将近25分钟,问题将再次出现,我需要再等待2分钟才能再次打开它。

注意:仅在生产机上没有此问题,而在开发机上却没有,在开发机上一切正常。

仅当我使用名称空间system.web.Ui而不是第一个应用程序页面或整个应用程序时出现问题。

请帮助诊断和解决此问题。

前端代码:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h3>TestPage</h3>
</asp:Content>

后端代码:

using System;
using System.Collections.Generic;
using System.Linq;
using system.web;
using system.web.UI;
using system.web.UI.WebControls;

namespace WebApplication2
{
    public partial class WebForm1 : system.web.UI.Page
    {
        protected void Page_Load(object sender,EventArgs e)
        {
            ScriptManager.RegisterClientScriptBlock(this,this.GetType(),"AlertBox","Alert('Hello World');",true);
        }
    }
}
cbfdhtrhyt 回答:如果我使用System.Web.Ui命名空间

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3130151.html

大家都在问