top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Difference between Global.asax & Web.config

0 votes
405 views
Difference between Global.asax & Web.config
posted Nov 5, 2015 by Sathaybama

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Global.asax – Global.asax is a class file, holds the Global application class and its intrinsic methods (e.g. Application and Session Events etc.).This file is get compiled on the first page hit to your Web application. We need to compile/rebuild application if there is change in global.asax file. We can also store connection strings as Application-level variables from Application_Start in global.asax.

Web.Config – The web.config is an XML-formatted text file that resides in the Web site’s root directory. We don’t have to do compile/rebuild with web.config change (you only have to save the web.config file) to reflect the change. The web.config file specifies configuration data for the .NET application, like custom error pages, authentication and authorization settings for the Web site, compilation options for the ASP.NET Web pages, if tracing should be enabled, and etc.Commonly we put connection strings in web.config.

answer Nov 5, 2015 by Shivaranjini
...