What is the Difference between Web.config and global.asax?
Can we write connection String code in global.asax?
Answer Posted / pragati
1. Web.config : It is an XML File
Global.asax file : It is an .asax file that is a class file
2. Web.config : We can have one or more web.config file.
Global.asax file : We can have only one global.asax files in one single application
3. Web.config : It consists of - a)Error Handling Codes b)Authentication c)Authorization
Global.asax file : It consists of - a)Application Events b)Session Events c)#include directive d)<object>declarations e)TypeLibrary Declarations
4. Web.config : It consists of ) HTTPHandlers
Global.asax file : It consists of declaration of objects,variables and methods.
5. Web.config : It is created by default thus,indicating its compulsion.
Global.asax file : It is an optional file.
6. Web.config : It is written in the form of HTML Tags.All configurations are mentioned in the <configuration> tag.
Global.asax file : All the code is written in valid browser scripts like JScript PerlScript, VBScript.
7. Web.config : It just needs to be saved and not be compiled to reflect the changes.
Global.asax file : It needs to compiled/rebuild to reflect the changes
8. Web.config : It consists of (a) HTTPHandlers
Global.asax file : It consists of events like :
(a)Application_OnStart
(b)Application_OnEnd
(c)Session_OnStart
(d)Session_OnEnd
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
How to implement role based security in asp.net mvc? : Asp.Net MVC
Why do we use datasource in asp.net?
What is the server of asp.net?
ASP.NET 2.0's new membership API used for creating and managing user account is exposed through which 2 clause?
Can one dll file contains the compiled code of more than one .net language?
What is an imagemap in asp.net?
Can we have multiple master pages in asp net?
Where is session data stored in asp net?
What is difference between asp.net and asp.net mvc? : Asp.Net MVC
Explain the updatepanel?
What is the postback property in asp.net?
What are the differences between the response.write() and response.output.write()?
What are different types of api?
What is distributed system in asp.net?
List the events in page life cycle.