本文介绍了会话时间到期后如何发出警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在SessionWarning附近得到预期的错误



<%= System.Configuration.ConfigurationSettings.AppSettings [SessionWarning]。ToString()% >;



我没有想法工作,所以请帮助,



什么我试过了:



am getting expected error in near "SessionWarning"

"<%= System.Configuration.ConfigurationSettings.AppSettings["SessionWarning"].ToString()%>";

I dont have idea to work outso plz help ,

What I have tried:

<configuration>
  <appSettings>
  <add key="isatdatapro.GatewayInterface" value="https://localhost:4433/GLGW/GWServices_v1/Messages.svc"/>
  </appSettings>
  <system.web>
    <sessionState mode="InProc" timeout="20"></sessionState>
    <trust level="Full"/>
    <customErrors mode="Off"/>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
  </system.web>
</configuration>










   var sessionTimeoutWarning =
    "<%= System.Configuration.ConfigurationSettings.AppSettings["SessionWarning"].ToString()%>";
        var sessionTimeout = "<%= Session.Timeout %>";

        var sTimeout = parseInt(sessionTimeoutWarning) * 60 * 1000;
        setTimeout('SessionWarning()', sTimeout);

        function SessionWarning() {
var message = "Your session will expire in another " +
    (parseInt(sessionTimeout) - parseInt(sessionTimeoutWarning)) +
    " mins! Please Save the data before the session expires";
alert(message);
        }

推荐答案

<appSettings>
   <add key="isatdatapro.GatewayInterface" value="https://localhost:4433/GLGW/GWServices_v1/Messages.svc"/>
   <add key="SessionWarning" value="your session will expire....."/>
 </appSettings>


这篇关于会话时间到期后如何发出警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 16:20