ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
What is web.config. How many web.config files can be allowed
to use in an application?
 Question Submitted By :: Poojitha
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is web.config. How many web.config files can be allowed to use in an application?
Answer
# 1
We can have number of config files in an application.
 
Is This Answer Correct ?    17 Yes 2 No
Swaroop
 
  Re: What is web.config. How many web.config files can be allowed to use in an application?
Answer
# 2
We can place any number of web.config files in ur 
aplication.u can place one web.config in one folder..
like this u can do..
 
Is This Answer Correct ?    16 Yes 3 No
Subrahmanyam
 
 
 
  Re: What is web.config. How many web.config files can be allowed to use in an application?
Answer
# 3
The ASP.NET Web.config file is used to define the 
configuration settings for an ASP.NET application. ASP.NET 
and the .NET Framework use .config files to define all 
configuration options. The .config files, including the 
ASP.NET Web.config file, are XML files. 

Server-wide configuration settings for the .NET Framework 
are defined in a file called Machine.config. The settings 
in the Machine.config file can be changed and those 
settings affect all .NET applications on the server. 

Different ASP.NET applications might need different 
application settings, that’s why defining those settings in 
the Machine.config file, is usually not practical. The 
solution for this problem is the ASP.NET Web.config file.

The ASP.NET application configuration settings can be 
changed by creating a file called Web.config and saving it 
in the root folder of the application. But what if the 
Machine.config file defines different settings than the 
ones defined in your Web.config file? The good news is that 
the settings in the Web.config file override the settings 
in the Machine.config file.
There can be more than one web.config file .
 
Is This Answer Correct ?    7 Yes 0 No
Mohanraj
 
  Re: What is web.config. How many web.config files can be allowed to use in an application?
Answer
# 4
System wide configuration settings are defined in the
Machine.config for the .NET Framework. The Machine.config
file is located in the
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG folder.
The settings defined in this file are applicable to all
ASP.NET applications in that system.

We can override these default settings by including a
Web.config file in the application's root folder.

By including Web.config files in sub-folders, we can
override the settings defined in the Web.config file in the
application's root folder.

The following are sample section declarations from a
Machine.config file:

<section name="processModel" 
 
type="System.Web.Configuration.ProcessModelConfigurationHandler,

        System.Web, Version=1.0.5000.0, Culture=neutral, 
        PublicKeyToken=b03f5f7f11d50a3a" 
  allowDefinition="MachineOnly"/>
 
<section name="sessionState" 
  type="System.Web.SessionState.SessionStateSectionHandler, 
        System.Web, Version=1.0.5000.0, Culture=neutral, 
        PublicKeyToken=b03f5f7f11d50a3a" 
  allowDefinition="MachineToApplication"/>
 
<section name="appSettings" 
  type="System.Configuration.NameValueFileSectionHandler,
System,
        Version=1.0.5000.0, Culture=neutral, 
        PublicKeyToken=b77a5c561934e089"/>

There is an attribute allowDefinition specified in the first
two section declarations with the values: MachineOnly and
MachineToApplication.
What it does mean?

If allowDefinition="MachineOnly", then we can not override
this section either in application level or in folder level.
The only section declared in the Machine.config file with
this settings is processModel.

If allowDefinition="MachineToApplication", then we can
override these sections by the root directory Web.config.
Sections with this setting in Machine.config are
authentication, machineKey, sessionState, trust, and
securityPolicy.

If allowDefinition attribute is omitted in a section
declaration of the Machine.config file, we can override that
section at any level.

We can override the section appSettings at any level and can
access it by using ConfigurationSettings.AppSettings easily.
What is there in the sample project?

The sample source code is a simple ASP.NET web application
with three Web Forms and three Web.config files. The root
folder has a sub folder SubFolder_L1 that has SubFolder_L2,
each has one Web Form and one Web.config file.

Web.config files have different and overridden keys.
Web.config file in the root folder has the following
appSettings declarations:

<appSettings>
    <add key="root" value="Root folder's configuration file."/>
    <add key="color" value="Blue"/>
</appSettings>

Web.config file in Subfolder_L1 has the following
appSettings declarations:

<appSettings>
    <add key="subfolder_l1" value="Subfolder_L1\web.config
file."/>
    <add key="color" value="Green"/>
</appSettings>

The color setting is overridden by the subfolder
configuration file. We can read the root element from
Subfolder_L1 or Subfolder_L2 by the following code:

lblConfig.Text = ConfigurationSettings.AppSettings["root"];

But we can not read configuration settings defined in
Subfolder_L1's Web.config file from the root folder.
 
Is This Answer Correct ?    4 Yes 0 No
Praveen Chandran
 
  Re: What is web.config. How many web.config files can be allowed to use in an application?
Answer
# 5
*  Configuration information is stored in XML-based text
files. You can use any standard text editor or XML parser to
create and edit ASP.NET configuration files.
    * Multiple configuration files, all named Web.config,
can appear in multiple directories on an ASP.NET Web
application server. Each Web.config file applies
configuration settings to its own directory and all child
directories below it. Configuration files in child
directories can supply configuration information in addition
to that inherited from parent directories, and the child
directory configuration settings can override or modify
settings defined in parent directories. The root
configuration file named
systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config
provides ASP.NET configuration settings for the entire Web
server.
    * At run time, ASP.NET uses the configuration
information provided by the Web.config files in a
hierarchical virtual directory structure to compute a
collection of configuration settings for each unique URL
resource. The resulting configuration settings are then
cached for all subsequent requests to a resource. Note that
inheritance is defined by the incoming request path (the
URL), not the file system paths to the resources on disk
(the physical paths).
    * ASP.NET detects changes to configuration files and
automatically applies new configuration settings to Web
resources affected by the changes. The server does not have
to be rebooted for the changes to take effect. Hierarchical
configuration settings are automatically recalculated and
recached whenever a configuration file in the hierarchy is
changed. The <processModel> section is an exception.
    * The ASP.NET configuration system is extensible. You
can define new configuration parameters and write
configuration section handlers to process them.
    * ASP.NET help protect configuration files from outside
access by configuring Internet Information Services (IIS) to
prevent direct browser access to configuration files. HTTP
access error 403 (forbidden) is returned to any browser
attempting to request a configuration file directly.

In This Section
 
Is This Answer Correct ?    3 Yes 2 No
Manikumar
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
Which institute provide good Project training on .Net technologies in hyd?  4
What is the difference between ASP and ASP.NET? TCS4
which is faster ArraytList Or Collection ? how? hows the Hashing works internally ? Emphasis2
What is mvc structure? given example? How to show gridview control from business components and using class object arrays?  1
what is view state  4
Types of state management techniques ? Digital-GlobalSoft2
Types of values mode can hold session state in Web.Config? Accenture6
Which tab of the web site administration tool do you use to manage application setting ,debug and tracing?  2
What is an application domain? Microsoft1
When would you not use the oleDbConnection object? a) To connect to an SQL 7.0 database. b) To connect to a DB/2 database. c) To connect to an Access database. d) To connect to an SQL 6.5 database. Syntax-Softtech5
What are the new page events added in Asp.net 2.0 ? Sapient5
repeater and gridview diff? Why is repeater fast than gridview? TCS2
What is SOAP, UDDI and WSDL ? Infosys1
How do you manage session in ASP and ASP.NET? Microsoft1
What tags do you need to add within the asp:datagrid tags to bind columns manually  2
Which template must you provide, in order to display data in a Repeater control? Wipro2
Which color scheme in a Repeater control can you provide alternatively?  1
How do you set language in web.cofig ? Keane-India-Ltd3
4. How do you plan to achieve these goals? Swatz-Oils2
Interface have Default Modifier Is 'Public'.Where We Will Use The KeyWord In Interface? Phoenix-Technologies3
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com