Tag: web config

在VS2013中debugging时的validation问题 – iis express

我试图在Visual Studio 2013中进行debugging时selectWindows用户名。我只是简单地使用: httpcontext.current.user.identity.name 如果我运行在我的开发服务器上,它工作正常,如果我在debugging模式下运行任何以前的版本的Visual Studio它也可以正常工作。 我的问题是 – 如果我在Visual Studio 2013上运行这个我得到一个空string。 我的网页configuration如下。 <system.web> <authentication mode="Windows"/> <identity impersonate="false"/> <authorization> <allow users="*"/> </authorization> <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/> <customErrors mode="Off"/> </system.web>

从JavaScript读取web.config

有没有什么办法,我可以阅读configuration值在web.config与JavaScript? 我为什么要这样做? 我有一个计时器在我的网站,这将popup一个模式对话框倒数计时器(倒计时2分钟),如果用户不活动20分钟。 如果用户没有回应,则将其注销。 如果他这样做,它会ping服务器(维护会话)并保持会话活着 这15分钟在js文件中被硬编码。 我宁愿要从一个configuration文件/其他文件,而不是硬编码到JS中捡起它 这里是代码片段 $.fn.idleTimeout = function(options) { var defaults = { //I would like to pick these values from some config file inactivity: 900000, //15 minutes noconfirm: 120000, //2 minutes sessionAlive: 900000, //15 minutes click_reset: true, logout_url: '/Views/Pages/Timeout.aspx' } 有什么build议么? 编辑:这是在一个单独的js文件。 执行<%=%>会给出错误“非法XML字符[Break on this error]不活动:<%= ConfigurationManager.AppSettings [”Inactivity“]%>;

使用rewriteModule从页面中删除.aspx?

我正在使用ASP .NET rewriteModule将http://example.com重写为http://www.example.com 。 <section name="rewriteModule" type="RewriteModule.RewriteModuleSectionHandler, RewriteModule"/> 然后我有这个<system.webServer>里面。 <rewrite> <rules> <rule name="Canonical" stopProcessing="true"> <match url=".*"/> <conditions> <add input="{HTTP_HOST}" pattern="^([az]+[.]com)$"/> </conditions> <action type="Redirect" url="http://www.{C:0}/{R:0}" redirectType="Permanent"/> </rule> </rules> </rewrite> 现在我想在我的页面结束时删除所有的.aspx文件。 例: http://www.example.com/Register.aspx 会变成: http://www.example.com/Register/ 我怎样才能做到这一点? 我在使用IIS7的GoDaddy共享虚拟主机上。

Web应用程序问题(web.config错误)使用IIS7.5和ASP.NET v2的HTTP 500.19

这是整个团队疯狂。 IIS或我们的Web服务器必须有一些简单的错误configuration部分,但每当我们尝试在IIS 7.5上运行ASP.NET Web应用程序时,我们都会得到以下错误… 这是完整的错误: HTTP Error 500.19 – Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. `Detailed Error Information` Module IIS Web Core Notification Unknown Handler Not yet determined Error Code 0x8007000d Config Error Config File \\?\E:\wwwroot\web.config Requested URL http://localhost:80/Default.aspx Physical Path Logon […]

<system.web>和<system.webServer>有什么区别?

每次我必须为ASP.NET添加一个处理程序或模块时,指令总是告诉我把它放到两个地方,system.web和system.webserver。 <system.web> <httpHandlers> </httpHandlers> <httpModules> </httpModules> </system.web> 和这个: <system.webServer> <modules> </modules> <handlers> </handlers> </system.webServer> 两者有什么区别? 补充:如果我不把它添加到我的system.web,我的VS 2008debugging器也不能正常工作。

HTTP错误500.19 – 内部服务器错误

我将我的应用程序从云端迁移到专用服务器。 专用服务器运行在带有IIS 7的Windows 2008服务器64位上。我的应用程序池在新服务器中处于集成模式。 我有一个default.htm页面作为起始页,它工作正常。 我无法访问任何其他页面,并遇到错误“HTTP错误500.19 – 内部服务器错误” 显示为错误的configuration源如下。 {system.webServer} 68: {httpErrors errorMode="DetailedLocalOnly" defaultPath="/errorpage-404.asp" defaultResponseMode="ExecuteURL"} 69: {remove statusCode="404" subStatusCode="-1" /} 请帮忙。 提前致谢!

允许web.config中的单个文件夹的匿名身份validation?

所以这里是这种情况,我有一个Asp.Net应用程序使用自定义身份validation和成员资格提供程序,但我们需要完全匿名访问(即)到应用程序中的特定文件夹。 在IISpipe理器中,您可以设置文件夹的身份validation模式,但是这些设置保存在C:\Windows\System32\inetsrv\config\applicationHost.config文件中,如此处所述 为了使安装更容易,如果我可以在我的web.config中设置它,但是经过几次尝试,我认为这可能是不可能的。 有谁知道吗? 非常感谢

在web场中添加machineKey到web.config

我们(真正的IT合作伙伴)最近改变了我们的一个网站养殖网站的一些DNS,以便两个生产服务器在两者之​​间进行循环DNS切换。 在这个开关之前,我们并没有真正遇到WebResource.axd文件的问题。 由于切换,当我们点击实时公开的URL,我们得到一个错误: CryptographicException 填充无效,无法删除。 当我们打到特定的服务器本身,他们加载罚款。 我已经研究了这个问题,似乎是因为他们在两台服务器之间共享资源,所以我们需要在每台服务器的web.config都有一个一致的machineKey ,以便他们能够在两者之间一致地进行encryption和解密。 我的问题是: 我可以通过服务器上的工具生成一个machineKey ,还是我需要编写代码来完成这个工作? 我是否需要将machineKey添加到每个服务器上的web.config ,或者您认为我需要做其他任何事情来使这两个服务器一起工作吗? (两个web.config目前没有一个machineKey )

如何在内置的visual studiodebugging器服务器中使用Web.debug.config?

我怎样才能在Visual Studio 2010内置debugging器中合并和使用Web.debug.config ?

app.config / web.config中的variables

是否可以在app.config或web.config文件中执行以下操作? <appSettings> <add key="MyBaseDir" value="C:\MyBase" /> <add key="Dir1" value="[MyBaseDir]\Dir1"/> <add key="Dir2" value="[MyBaseDir]\Dir2"/> </appSettings> 然后我想在我的代码中访问Dir2,只需说: ConfigurationManager.AppSettings["Dir2"] 这将帮助我在不同的服务器和位置安装我的应用程序时,我将只需要更改我的整个app.config一个条目。 (我知道我可以pipe理代码中的所有连接,但我更喜欢这种方式)。