web-config

Configuring MVC for SimpleMembership

依然范特西╮ 提交于 2020-01-26 01:35:33
问题 I have an ASP.NET MVC application with a number of membership-related pages generated from the project templates. When I attempt to access one of those pages, I get the following error: The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588. After some time spent researching, I determined I was missing the connection string. I have an existing connection string named FreeWebFilesEntities and I created a

UltiDev Cassini and <system.webServer> web.config settings

南楼画角 提交于 2020-01-25 10:45:07
问题 MS Cassini Development Web Server is a nice product that executes web requests in a similar way that IIS7 does. Every request (event for static content) goes through the same .Net pipeline without exception. All custom HttpModule can handle any request. But sometimes you don't want these modules to execute for certain content (most often static content). In this regard, MS Cassini doesn't read/obey <system.webServer> web.config settings like IIS7 does. I'm particularly interested in these

Custom error handling Asp.Net

自作多情 提交于 2020-01-24 09:05:07
问题 On my web application, I had configured my web.config file to set customerrors to ON, so here it is: <customErrors mode="On" defaultRedirect="Error.aspx"> <error statusCode="403" redirect="Error.aspx" /> <error statusCode="404" redirect="Error.aspx" /> </customErrors> For explaining propouses I only captured the 403 and 404 error (and the defaultRedirect obviously). But I would like to get more details of the error on the page: Error.aspx somehow; but not creating each page for each kind of

Can i read data from web.config using JQuery?

我只是一个虾纸丫 提交于 2020-01-23 13:57:59
问题 Can i read data from web.config using JQuery ? 回答1: Jquery is javascript that runs in your browser, your web.config resides on your server. If you want to expose data from your web.config, I think you should create some kind of webservice that you can call from the client side javascript to get the data you want. If you would be able to directly read from the web.config file, then it would be a major security risk as the web.config file is often used for storing sensitive information like

Nuget Config.Transform Formatting Issue

左心房为你撑大大i 提交于 2020-01-23 08:41:05
问题 I have created a Nuget config transform file that has the following transformation: <?xml version="1.0"> <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="NetTcpBinding_IMyService" /> </netTcpBinding> </bindings> <client> <endpoint address="net.tcp://mydomain/MySvc/MySvc.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IMyService" contract="MyNamespace.MyService" name="NetTcpBinding_IMyService"> <identity> <userPrincipalName value="admin@mydomain

Can't read appSettings value from Web.Config

左心房为你撑大大i 提交于 2020-01-23 07:02:10
问题 I have the following in my web.config: <configuration> <appSettings> <add key="PsychMon" value="true"/> </appSettings> . . . </configuration> I have the following code in my codebehind: System.Configuration.Configuration webConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(null) ; However, when I look at webConfig, webConfig.AppSettings.Settings.Count = 0 . Why is it not reading the app setting? What I want to do is be able to get the setting by using: System

External AppSettings File NOT merging with web.config

故事扮演 提交于 2020-01-21 06:41:11
问题 In my app, I have a web.config file with an appSettings section. The appSettings section contains a number of keys that the app uses. The appSettings section also contains the file="AppSettings.config" attribute. The AppSettings.config file then contains a subset of the values from the main web.config. The idea is for the web.config to contain all the base/default settings, and then to provide overrides of the defaults in the AppSettings.config file. According to this post (https:/

External AppSettings File NOT merging with web.config

被刻印的时光 ゝ 提交于 2020-01-21 06:41:09
问题 In my app, I have a web.config file with an appSettings section. The appSettings section contains a number of keys that the app uses. The appSettings section also contains the file="AppSettings.config" attribute. The AppSettings.config file then contains a subset of the values from the main web.config. The idea is for the web.config to contain all the base/default settings, and then to provide overrides of the defaults in the AppSettings.config file. According to this post (https:/

IIS 7 Force Fresh Images

╄→尐↘猪︶ㄣ 提交于 2020-01-19 14:15:47
问题 How do I force IIS 7 to not cache images for a particular page? 回答1: In IIS7, you can do this either declaratively in your web.config, or programmatically. <location path="YourPath"> <system.webServer> <staticContent> <clientCache cacheControlMode="DisableCache" /> </staticContent> </system.webServer> </location> The programmatic solution requires a simple HttpModule that's registered to run for all requests in Integrated mode, where you look for the URLs that you're concerned about. Then

IIS 7 Force Fresh Images

Deadly 提交于 2020-01-19 14:14:59
问题 How do I force IIS 7 to not cache images for a particular page? 回答1: In IIS7, you can do this either declaratively in your web.config, or programmatically. <location path="YourPath"> <system.webServer> <staticContent> <clientCache cacheControlMode="DisableCache" /> </staticContent> </system.webServer> </location> The programmatic solution requires a simple HttpModule that's registered to run for all requests in Integrated mode, where you look for the URLs that you're concerned about. Then