ASP.NET Interview Questions and Answers (1544) - Page 50

What do you mean by IIS Metabase ?

For storing Internet Information Server (IIS) configuration settings, we use metabase which is a structure.It is specific to Internet Information Server version 4.0 but performs some of the same functions as the Windows system registry.New keys and values are added for flexible control of IIS.
Are ASP.NET Pages compliant with XHTML ?

XHTML stands for EXtensible Hypertext Markup Language and is a W3C Recommendation.XHTML is a stricter and cleaner version of HTML.
Yes, ASP.NET 2.0 Pages are XHTML compliant. The user has the freedom to include the appropriate document type declaration.
Without deploying the source code on the server, can we deploy the application ?

Yes. You can deploy your code by using a new precompilation process called ‘precompilation for deployment’.
You can use the aspnet_compiler.exe to precompile a site. This process builds each page in your web application into a single application DLL and some placeholder files. These files can then be deployed to the server.
You can also accomplish the same task using Visual Studio 2005 by using the Build->Publish menu.
What is the ideal size of a ViewState and how does it affect the performance ?

Viewstate stores the state of controls in HTML hidden fields. This information can grow in size. This will affect the overall responsiveness of the page, thereby affecting performance.
The ideal size of a viewstate should be not more than 25-30% of the page size.
How can you detect if a viewstate is tampered ?

The EnableViewStateMac attribute will check the encoded and encrypted viewstate for tampering.
By setting the EnableViewStateMac to true in the @Page directive you can detect if a viewstate is tampered.
Does an application supports different programming languages in it ?

Yes. Each page can be written with a different programming language in the same application. You can create a few pages in C# and a few in VB.NET.
Can the App_Code folder contain source code files in different programming languages?

No. All source code files kept in the root App_Code folder must be in the same programming language.
You can create two subfolders inside the App_Code and then add both C# and VB.NET in the respective subfolders. You also have to add configuration settings in the web.config for this to work.
How do you secure your configuration files to be accessed remotely by unauthorized users?

ASP.NET configures IIS to deny access to any user that requests access to the Machine.config or Web.config files.
How can I configure ASP.NET applications that are running on a remote machine ?

You can configure ASP.NET applications that are running on a remote machine by using the Web Site Administration Tool to configure remote websites.
How many web.config files can an application have ?

You can have multiple web.config files in an application. There is another advantage that, you can place a Web.config file inside a folder or wherever you need (apart from some exceptions) to override the configuration settings that are inherited from a configuration file located at a higher level in the hierarchy.
How can you change a Master Page dynamically at runtime and How ?

You can change a master page dynamically at runtime. For this, you have to set the MasterPageFile property to point to the .master page during the PreInit page event.
What is the .Net framework?

.Net framework is the technology on which .Net applications are developed and deployed. The framework consist of three main components -

1. CLR (Comman Langauge Runtime)
2. Unified Classes (Framework Base Classes)
3. User and Program Interface (ASP.Net, Winforms)
What is the Garbage Collection in ASP.Net ?

GC is the process whereby the Common Language Runtime (CLR) reclaims memory that is no longer in use—i.e., no longer referenced by an active object. Objects on the heap are garbage collected after the final reference to them is destroyed. The exact moment of collection is determined by the CLR. Memory for stack values is freed up immediately when the stack frame in which they are declared ends—e.g., when a method returns.
What is the the Page_Load Event in ASP.Net?

The Page_Load event is one of many events that ASP.Net understands. The Page_Load event is triggered when a page loads, and ASP.Net will automatically call the subroutine Page_Load, and execute the code inside it.
What's the difference between a URI and a URL?

URI: A description of something, following an accepted format, that can define both or either the unique name (identification) of something and its location.It is a general identifier.

URL: URL's are a subset of URI's (which also contain URNs).A URL specifies a location and a URN specifies a name.
What happens when the web.config file is made any changes and saved in the live server ?

If you are working on the web.config for a live site (which is not recommended), every time the file is saved the website will restart.


Thanks and Regards
Akiii
What does MapPath method actually do ?

MapPath method resolves virtual paths and physical paths. The paths of the ASP.NET development server are not the same as they are on a server. The MapPath method handles this for us.


Thanks and Regards
Akiii
What does the .(dot) represents in Server.MapPath method ?

The .(Dot) represents the current directory.

//current directory

string str = Server.MapPath(".")



Thanks and Regards
Akiii
What does the ..(double dot) represents in Server.MapPath method ?

Double dot(..) represents the parent directory.

//parent directory

string str = Server.MapPath("..")



Thanks and Regards
Akiii
What does the /(forward slash) represents in Server.MapPath method ?

It represents the application's root directory :-

//application's root directory

string str= Server.MapPath("/")




Thanks and Regards
Akiii
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories