Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Asp.net网站配置,页面未写入日志_C#_Asp.net_Iis_Logging - Fatal编程技术网

C# Asp.net网站配置,页面未写入日志

C# Asp.net网站配置,页面未写入日志,c#,asp.net,iis,logging,C#,Asp.net,Iis,Logging,我有一个很奇怪的问题 以下是我的Default.aspx页面隐藏代码: protected void Page_Load(object sender, EventArgs e) { WebUtils.WriteLog("On the login page"); if (IsPostBack) { if (!String.IsNullOrEmpty(txtUsername.Text) && !String.IsNullOrEmpty(txt

我有一个很奇怪的问题

以下是我的Default.aspx页面隐藏代码:

protected void Page_Load(object sender, EventArgs e)
{
    WebUtils.WriteLog("On the login page");
    if (IsPostBack)
    {

        if (!String.IsNullOrEmpty(txtUsername.Text) && !String.IsNullOrEmpty(txtPassword.Text))
        {
            WebUtils.WriteLog("On essai de connecter" + txtUsername.Text);
            UIBase temp = new UIBase();

            FIQFacade facade = temp.facade;

            User user = (User)facade.userFact.GetObjectByLoginName(txtUsername.Text);

            if (user != null)
            {
                WebUtils.WriteLog("User Trouvé" + txtUsername.Text);
                if (user.Password == WebUtils.getMd5Hash(txtPassword.Text))
                {
                    User userLogin = (User)facade.userFact.GetObjectByLoginName(txtUsername.Text);
                    if (userLogin != null)
                    {
                        Session[UIBase.CST_LOGGED_USER] = userLogin;
                        WebUtils.WriteLog("On ce log" + txtUsername.Text);
                        Response.Redirect("pages/ReservationSalleInterne.aspx");
                    }
                }
                else if (facade.userFact.UserLoginDataIsValid(txtUsername.Text, txtPassword.Text, "NDS", configs["ldapPath"].ToString(), ""))
                {
                    User userLogin = (User)facade.userFact.GetObjectByLoginName(txtUsername.Text);
                    Session[UIBase.CST_LOGGED_USER] = userLogin;
                    WebUtils.WriteLog("On ce log" + txtUsername.Text);
                    Response.Redirect("pages/ReservationSalleInterne.aspx");
                }
            }

        }

    }
    else
    {
        WebUtils.WriteLog("On est pas en postback on delogue" );
        Session[UIBase.CST_LOGGED_USER] = null;
        Session["langue"] = "1";
    }
}



}
以下是我的Defautl.aspx页面代码:

<%@ Page Language="C#"  AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page" %>
<!doctype html>
<!--[if lt IE 8 ]><html lang="en" class="no-js ie ie7"><![endif]-->
<!--[if IE 8 ]><html lang="en" class="no-js ie"><![endif]-->
<!--[if (gt IE 8)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>Desa Altilogix</title>
<meta name="description" content="">
<meta name="author" content="">

<!-- Global stylesheets -->
<link href="css/reset.css" rel="stylesheet" type="text/css">
<link href="css/common.css" rel="stylesheet" type="text/css">
<link href="css/form.css" rel="stylesheet" type="text/css">
<link href="css/standard.css" rel="stylesheet" type="text/css">
<link href="css/special-pages.css" rel="stylesheet" type="text/css">

<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/png" href="favicon-large.png">

<!-- Modernizr for support detection, all javascript libs are moved right above     </body> for better performance -->
<script src="js/libs/modernizr.custom.min.js"></script>

 </head>

 <!-- the 'special-page' class is only an identifier for scripts -->
 <body class="special-page login-bg dark">



<section id="login-block">
    <div class="block-border"><div class="block-content">

        <!--
        IE7 compatibility: if you want to remove the <h1>, 
        add style="zoom:1" to the above .block-content div
        -->

        <div class="block-header"><img src="images/LogoDesa.png"  style="height:70px;"/></div>

        <!--<p class="message error no-margin">Error message</p>-->

        <form class="form with-margin" name="login-form" id="login"  runat="server">
            <input type="hidden" name="a" id="a" value="send">
            <p class="inline-small-label">
                <label for="login"><span class="admin">Utilisateur</span></label>
                <asp:TextBox  type="text" name="login" id="txtUsername" class="full-width" value="" runat="server" />

            </p>
            <p class="inline-small-label">
                <label for="pass"><span class="admin">Mot de passe</span></label>
                <asp:TextBox   TextMode="Password" name="pass" id="txtPassword" class="full-width" value="" runat="server"/>

            </p>

            <button type="submit"  class="float-right" runat="server" Text="Login">Se connecter</button>

            <p class="input-height">
                <input type="checkbox" name="keep-logged" id="keep-logged" value="1" class="mini-switch" checked="checked">
                <label for="keep-logged" class="inline">Rester connecté</label>
            </p>
        </form>

    </div></div>
</section>

<!--

Updated as v1.5:
Libs are moved here to improve performance

-->

<!-- Generic libs -->
<script src="js/libs/jquery-1.6.3.min.js"></script>
<script src="js/old-browsers.js"></script>      <!-- remove if you do not need older browsers detection -->

<!-- Template libs -->
<script src="js/common.js"></script>
<script src="js/standard.js"></script>
<!--[if lte IE 8]><script src="js/standard.ie.js"></script><![endif]-->
<script src="js/jquery.tip.js"></script>

<!-- example login script -->


</body>
</html>

德萨阿尔蒂洛希克斯酒店

利用者

我刚刚在这个页面中添加了日志,这也是同样的问题。当我的dropdownlist停止工作时,日志不会被写入。真是奇怪的问题,希望有人能帮我

编辑2:

这是我的web.config

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
Note: As an alternative to hand editing this file you can use the 
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in 
machine.config.comments usually located in 
\Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
  <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">




    </sectionGroup>
  </sectionGroup>
 </sectionGroup>
  </configSections>
  <appSettings>
    <add key="conn_string" value="data source=HY-SQL;initial catalog=reservation;user id=UserAboveReservation;password=UserAboveReservation" />
    <add key="defaultUserID" value="1" />
  </appSettings>
  <connectionStrings />
  <system.web>


        <sessionState mode="InProc"  />
  </system.web>

</configuration>

编辑3:


即使你不知道解决方案,也许给了我一个暗示或想法。。。因为我现在正在抽气。起初我认为这是一个会话问题,但当我看到日志没有写入文件时,我就失去了所有希望;)也许是饼干问题,客户端的问题。。。请帮忙:)

我发现了问题

已在IIS中为所有.aspx页面启用输出缓存

删除此项更正了我所有的问题

谢谢大家