web-config

asp.net, url rewrite module and web.config

Hi, i'm using ASP.net with .NET 3.5 on IIS7 (Vista) with the URL Rewrite Module from Microsoft. This means, that i have a <system.webServer> <rewrite>...</rewrite> ... </system.webServer> section within the web.config, but i get a warning, that within the system.webServer the element "rewrite" is not allowed. How can i con...

ASP.NET configuration not attached with the library

I'm working on a solution that has two projects: One ASP.NET web application, and one Custom Web Control library. The custom control library is used in the asp.net application. When I compile the solution, the app.config file of the custom web control library is not transfered with the dll to the ASP.NET apllications bin folder? How can...

How can I add an ampersand for a value in a ASP.net/C# app config file value

I've got a C# program with values in a config file. What I want is to store ampersands for an url value like... <appSettings> <add key="myurl" value="http://www.myurl.com?&amp;cid=&amp;sid="/&gt; </appSettings> But I get errors building my site. The ampersand is not allowed. I've tried various forms of escaping the ampersands to ...

Best way to retrieve the connection string for IBATIS.NET from the web.config

I have an web application where I have a requirement to encrypt and store the connection string in the web.config. What is the best way to retrieve this and use this connection string with IBATIS.NET instead of storing the connection string in the SqlMap.config? ...

web.config in nested folder

Hello All, I am trying to install an app inside of another web app. I have my .aspx pages and some code that I was putting into the main app's app_code folder. I've added my own web.config file for my connection string and such but I think there's a conflict. So my question is a two parter. First, what is the best way to install an app ...

How do you set different web.config default error pages based on website section using ASP.NET MVC

I think this is pretty typical, you have the same website project with an "admin" section and a public facing section. In this website I want to configure the default errors, but I also want them to display in the correct layout. (the admin looks different than the public facing site). In webforms you could put a different web.config in...

Merge and override .NET configuration files with C#

I wrote this piece of code to merge two .NET configuration files: Add non existent nodes and override values on existing ones. I avoided to use the much faster reader/writer way because the app I'm using it for is not performance critical. What do you think of this? using System; using System.Xml; namespace devcoach.FrameworkExtension...

ASP.NET Dynamic Data & Membership (Roles)

hi Everyone, I am trying to setup roles in a dynamic data website.. the problem is that i cant set it by simpy doing this. <location path="List.aspx"> <system.web> <authorization> <allow roles="Administrators" /> <deny users="*" /> </authorization> </system.web> </location> so even when i lo...

How do I deny access to .dll files in a web site (on both IIS 6 and 7)

If I use an URL like http://mysite/myfolder/myfile.dll, I get a dialog "Do you want to open or save this file". Of course, I don't want people to be able to download and disassembly our dll's. How can I deny people accessing such files directly ? ...

ASP.NET - Negative numbers in Parenthesis

Hi, My application is currently displaying negative numbers as -1. The users have changed the requirements (just for a change!) and now we will have to display the numbers as (1). Can I enable that for the whole application say changing the web.config or even the app's CultureInfo ? Is there any side effect of doing that since we have l...

ASP.NET solution with class library project

I have an solution in VS 2008 which contains two class library projects and an ASP.NET web site. The ASP.NET site references the class libraries and one of the libraries contains a LINQ To SQL item. My question is with regards to the app.config in the class library which contains the connection string for the database. When I build the ...

How to create a connection string outside web.config

Hi, Just thinking about this, is it possible to create a connection string outside the ASP.NET's web.config? ...

ASP.Net Forms Authentication Logging out users after 10 minutes.

I am having a really bad issue where no matter what I try, the user is being logged off after 10 minutes. I am using ASP.Net 2.0 running on IIS 6.0 on Server 2003 R2 Standard Edition running as a Virtual Server with all applicable updates and .Net 3.5 SP1. The client is Internet Explorer 7.0 Below are the web.config settings: <!-- Au...

C# namespaces in web.config

Coming from a VB background and being forced to learn C# I have hit the first hurdle. In VB i could put all the namespaces I wanted available across the entire app in the web.config file and it would be available in each code behind file without me having to add import statements. <namespaces> <clear/> <add namespace="System"/> <add ...

What is the type of <location> section in Web.config?

I was expecting to find that section within "System.Web.Configuration" namespace just like other Web.config sections Under what namespace does "location" reside and what is the type of the section? ...

How can I retrieve an assembly's qualified type name?

How can I generate a assembly qualified type name? For an example, when configuring a membership provider, I would have to provide a assembly qualified type name for "SqlMembershipProvider" (in this example, i have copied the below configuration from somewhere) in "type" attribute. How do you generate that assembly qualified type name?...

Is my WCF using the correct Binding?

Hi, My wcf service's web.config looks like this: How can I confirm that it is using the settings correctly? I still get this timeout error sometimes even though I have configured the binding to use: SendTimeout = 10 minutes etc. ? <system.serviceModel> <services> <service behaviorConfiguration="MyService.MyServiceBehavior"...

How to enable SSL for SmtpClient in Web.config

Is there a way to set the EnableSSL from the web.config? I could set this property in code, but that wouldn't work for the Simple Mail Web Event and other classes that uses the default Smtp Server. Any ideas? ...

Converting an ASP.NET site into a SharePoint site using ODBC connection and not SQL

Hi I followed this article http://www.codeproject.com/KB/sharepoint/ASPNET_to_Sharepoint.aspx and it worked converting my ASP.net Site into SharePoint with a SQL Datasoure. Does anyone know what i must do in the Web.config of my SharePoint site in order to make my ODBC connection SAVE? My ODBC connection = SafeControl Assembly="Samras...

ASP.NET - Trust Level = Full?

I recently joined a firm and when analyzing their environment I noticed that the SharePoint web.config had the trust level set to Full. I know this is an absolutely terrible practice and was hoping the stackoverflow community could help me outline the flaws in this decision. Oh, it appears this decision was made to allow the develope...