473,507 Members | 2,472 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Verifying web.config

Tim
Hi,

In my asp.net application, I wish to double check some of the options set in
the web.config file during application startup to make sure that for example
errors are never going to be reported to the internet user and that debug is
not set to true etc.

How does one read the following values?

<system.web>
<compilation defaultLanguage="vb" debug="true" />

<customErrors mode="RemoteOnly" />

I have read through and tried many of the different ConfigurationSettings
objects etc but always get either nothing or an exception.

There are also several appSettings that are mandatory...

If I detect a show stopper setting then what do I need to do to stop the
application startup?

Thanks for any help,

- Tim


Nov 19 '05 #1
3 1175
I'm presuming you are using ConfigurationSettings.GetConfig(string
sectionname).

When you detect and error you can really stop your application starting as
in order to do the checks it has already started. With appropriately placed
Exception handling you should redirect your application to a standard page
that displays a friendly error message to the user and log you error where
you see fit.

MattC
"Tim" <Tim@NoSpam> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

In my asp.net application, I wish to double check some of the options set
in the web.config file during application startup to make sure that for
example errors are never going to be reported to the internet user and
that debug is not set to true etc.

How does one read the following values?

<system.web>
<compilation defaultLanguage="vb" debug="true" />

<customErrors mode="RemoteOnly" />

I have read through and tried many of the different ConfigurationSettings
objects etc but always get either nothing or an exception.

There are also several appSettings that are mandatory...

If I detect a show stopper setting then what do I need to do to stop the
application startup?

Thanks for any help,

- Tim

Nov 19 '05 #2
You can always use just plain XPath on the web.config. The ASPNET user
obviously has access to this file, and some simple XPath statements will
return the properties you are interested in.

--

- Paul Glavich
ASP.NET MVP
ASPInsider (www.aspinsiders.com)
"Tim" <Tim@NoSpam> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,

In my asp.net application, I wish to double check some of the options set in the web.config file during application startup to make sure that for example errors are never going to be reported to the internet user and that debug is not set to true etc.

How does one read the following values?

<system.web>
<compilation defaultLanguage="vb" debug="true" />

<customErrors mode="RemoteOnly" />

I have read through and tried many of the different ConfigurationSettings
objects etc but always get either nothing or an exception.

There are also several appSettings that are mandatory...

If I detect a show stopper setting then what do I need to do to stop the
application startup?

Thanks for any help,

- Tim

Nov 19 '05 #3
Tim
Matt, Paul: Thanks.
- Tim

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2882
by: Marc Poulhiès | last post by:
Hi, I'm trying to build a system using HTTPS with python clients that have to verify the server's identity. From the Python document, it seems that the server's certificate is not veryfied, and...
4
2716
by: Michael | last post by:
I'd like to write a program to verify the consistency between various database replicas in our environment. The rules are as follows: - I'm given two servers, each with a database - I don't...
1
3208
by: Marcus | last post by:
Hi What is a proper way of verifying that a mysql write was successfull, and to retry if it wasnt? In my perl script I add records through: my $dbh=DBI->connect($dsn, $db_user_name,...
10
3539
by: Chris Sharman | last post by:
I'm doing a rough validation of an email address client-side (using js), but it's not enough - our customer service people are apparently incapable of typing in an email address without error - we...
4
1560
by: HD | last post by:
Hi, I was wondering if there is a way of verifying information that is in the registry of the user's computer??? Or is there a way of checking if a file is on the c:\ of the user's computer?? I...
9
2086
by: Carter Smith | last post by:
http://www.icarusindie.com/wiki/index.php/Server-Side_Javascript_Check Sample source included This method requires that your pages are PHP enabled and you have mySQL. Although I suppose you...
6
1278
by: John | last post by:
Hi I have several web forms that require users verification by entering a code before they are allowed in. I have created a separate web form for entering and verifying user code. How do I...
2
2304
by: Robert Scheer | last post by:
Hi. My site needs to know if the user is connected before executing some queries on my database. Actually, I have a page loaded by an Iframe that runs every 30 seconds and updates a field on my...
5
3992
by: Geisler, Jim | last post by:
So, as far as I know, PostgreSQL does not have any way of verifying the loss of referential integrity. Are there any recommended methods or utilities for checking referential integrity in a...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.