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.