Dotnet differences compiled -1


Published on

365 Dotnet Difference Between Questions & Answers from the blog:

Published in: Technology
1 Comment
  • Hi Umar, All your articles are quite good, and I try to read sll of them. All the best & Thanks
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Dotnet differences compiled -1

  1. 1. ADO.NET Difference FAQs-1 1. What are the differences between DataReader and DataAdapter? S.No DataReader DataAdapter 1 Works in Connected Mode Works in Disconnected Mode 2 Can have only one record at a Can have more than 1 records time 3 Is ForwardOnly and Readonly Can navigate front and back and editable 4 Faster Slower 2. What are the differences between DataSet and DataReader? S.No DataSet DataReader 1 The data store whose records You can read data from datareader have to be manipulated can be only if the connection to data store disconnected. exists. 2 You have the provision to cache Caching of data is not possible. data fetched from data store when using dataset. 3 Dataset objects have XML XML Support is not provided by Support. datareader. 4 A single dataset object can Datareader can read records contain collection of datatable fetched by a command object objects wherein each datatable containing a single query. If you object refers to a table in the have to fetch data from multiple datastore. Hence you can tables, then datareader is not manipulate on multiple tables advantageous when compared to using a dataset. dataset. 5 Using dataset, you can read the While reading records, you can records fetched in any order. iterate only in forward direction. 6 Performance wise, dataset is Datareader gives high performance slow because it has multiple and records can be fetched faster tables which in turn include when compared to dataset. multiple rows, columns and constraints. 3. What is the difference between DataSet.Copy() and DataSet.Clone()? S.No DataSet.Copy() DataSet.Clone() 1 DataSet.Copy() copies both the DataSet.Clone() copies the structure and data structure of the DataSet, including all DataTable schemas, relations,
  2. 2. and constraints and it does not copy any data4. What are the differences between RecordSet and DataSet? S.No RecordSet DataSet 1 RecordSet provides data of one DataSet is a data structure which row at an instant represents the complete table data at the same time 2 RecordSet always needs an DataSet needs connection only for Open connection to read the retrieving the data. After retrieve the data from data sources data connection is not necessary 3 RecordSet is able to load the DataSet has the capability to store structure and data of only one the structure and data of multiple table at a time tables at a time 4 RecordSet does not support DataSet enforces data integrity by constraints of Databases using Constraints5. What are the differences between ADO and ADO.Net? S.No ADO ADO.Net 1 It is a COM based library. It is a CLR based library. 2 Classic ADO requires active ADO.NET architecture works while the connection with the data store. data store is disconnected. 3 Locking feature is available. Locking feature is not available. 4 Data is stored in binary format. Data is stored in XML. 5 XML integration is not possible. XML integration is possible. 6 It uses the object named It uses Dataset Object for data access Recordset to reference data from and representation. the data store. 7 Using Classic ADO, you can Dataset object of ADO.NET includes obtain information from one table collection of DataTables wherein each or set of tables through join. You DataTable will contain records fetched cannot fetch records from multiple from a particular table. Hence multiple tables independently. table records are maintained independently. 8 Firewall might prevent execution ADO.NET has firewall proof and its of Classic ADO. execution will never be interrupted. 9 Classic ADO architecture includes ADO.NET architecture doesnt include client side cursor and server side such cursors. cursor.
  3. 3. 10 You cannot send multiple You can send multiple transactions transactions using a single using a single connection instance. connection instance.Reference: Difference FAQs-21.Difference between Typed DataSet and Untyped DataSet S.No Typed DataSet Untyped DataSet 1 It provides additional methods, It is not as easy to use as strongly properties and events and thus typed dataset. it makes it easier to use. 2 They have .xsd file (Xml They do not do error checking at Schema definition) file the design time as they are filled at associated with them and do run time when the code executes. error checking regarding their schema at design time using the .xsd definitions. 3 We will get advantage of We cannot get an advantage of intelliSense in VS. NET. intelliSense. 4 Performance is slower in case Performance is faster in case of of strongly typed dataset. Untyped dataset. 5 In complex environment, Untyped datasets are easy to strongly typed datasets are administer. difficult to administer.Typed DataSets use explicit names and DataTypes for their members.ex:northwindDataSet.Products.ProductNameColumn.Caption = "pnames";UnTyped DataSets use table and column collections for their membersex:ds.Tables["emp"].Columns["eno"].ReadOnly=true;2.Difference between DataView and DataTable S.No DataView DataTable 1 Read-only i.e., DataView can Read/Write i.e., Datatable can be be used to select the data. used to edit or select or delete or insert a data.
  4. 4. 2 Is a reference to an existing Can be created empty and then DataTable. Cannot be populated populated from scratch; must be instantiated with a reference to an existing DataTable. 3 Data is a reference to an Data takes storage space. existing DataTable, and does not consume space. 4 Can sort or filter rows without Can add/edit/delete rows, columns, modifying the underlying data. and data, and all changes are Rows and columns can be persistent. hidden and revealed repeatedly. 5 Can return a DataTable version Can be cloned of the view 6 A live reference to a Is source data; does not contain DataTable; any changes in the references DataTable data is immediately reflected in the view. 7 Supports calculated columns, Does not support calculated which are columns with a value columns calculated on the fly by combining or manipulating other columns. 8 Can hide or show selected No row or column hiding columns3.Difference between Connected and Disconnected Environment S.No Connected Environment Disconnected Environment 1 Connected Environment needs Disconnected Environment does a constantly connection of user not need any connection. to data source while performing any operation. 2 Only one operation can be Multiple operations can be performed at a time in performed. connection Environment. 3 DataReader is used in DataSet is used in it. Connection Environment. 4 It is slower in speed. Disconnected Environment has a good speed.
  5. 5. 5 We get updated data in it. There is a problem of dirty read.Reference: Difference FAQs-31.Difference between ExecuteNonQuery() and ExecuteScalar() methods in ADO.NET S.No ExecuteNonQuery() ExecuteScalar() 1 It will work with Action Queries It will work with Non-Action Queries only that contain aggregate functions. (Create,Alter,Drop,Insert,Updat e,Delete). 2 It returns the count of rows It returns the first row and first effected by the Query. column value of the query result. 3 Return type is int Return type is object. 4 Return value is optional and Return value is compulsory and can be assigned to an integer should be assigned to a variable of variable. required type.Example-1 for ExecuteNonQuery Method -Insert:SqlCommand cmd = new SqlCommand("Insert Into SampleTable Values(1,2)",con);//con is the connection objectcon.Open();cmd.ExecuteNonQuery(); //The SQL Insert Statement gets executedExample-2 for ExecuteNonQuery Method - Update:public void UpdateEmployeeEmail(){SqlConnection conn = new SqlConnection(connString))String sqlQuery = "UPDATE Employee SET WHEREempid=5;SqlCommand cmd = new SqlCommand(sqlQuery, conn);try{conn.Open();cmd.ExecuteNonQuery();}catch (Exception ex){Console.WriteLine(ex.Message);}finally{
  6. 6. conn.Close();}return count;}Example-1 for ExecuteScalar Method:This returns only one value that is first column value of the first row in the executed querypublic int getSomeProdId(){int count=0;SqlConnection conn = new SqlConnection(connString))String sqlQuery = "SELECT COUNT(*) FROM dbo.region";SqlCommand cmd = new SqlCommand(sqlQuery, conn);try{conn.Open();//Since return type is System.Object, a typecast is mustcount = (Int32)cmd.ExecuteScalar();}catch (Exception ex){Console.WriteLine(ex.Message);}finally{conn.Close();}return count;}Example-2 for ExecuteScalar Method:This returns one value only, no recordsets.cmd.CommandText = "Select Name, DOB, from Emp where ID=1";Dim strName As string = cmd.ExecuteScalar.ToString2.Difference between ExecuteNonQuery() and ExecuteReader() methods inADO.NET S.No ExecuteNonQuery() ExecuteReader() 1 It will work with Action Queries It will work with Action and Non- only Action Queries (Select) (Create,Alter,Drop,Insert,Updat e,Delete).
  7. 7. 2 It returns the count of rows It returns the collection of rows effected by the Query. selected by the Query. 3 Return type is int Return type is DataReader. 4 Return value is optional and Return value is compulsory and can be assigned to an integer should be assigned to an another variable. object DataReader.Example-1 for ExecuteNonQuery Method -Insert:SqlCommand cmd = new SqlCommand("Insert Into SampleTable Values(1,2)",con);//con is the connection objectcon.Open();cmd.ExecuteNonQuery(); //The SQL Insert Statement gets executedExample-2 for ExecuteNonQuery Method - Update:public void UpdateEmployeeEmail(){SqlConnection conn = new SqlConnection(connString))String sqlQuery = "UPDATE Employee SET WHEREempid=5;SqlCommand cmd = new SqlCommand(sqlQuery, conn);try{conn.Open();cmd.ExecuteNonQuery();}catch (Exception ex){Console.WriteLine(ex.Message);}finally{conn.Close();}return count;}Example for ExecuteReader Method:Here, ExecuteReader is used to get set of records by specified query, namely, "select *from emp"SqlConnection con = new SqlConnection(constr); //constructor can be connection of string.SqlCommand cmd = new SqlCommand ("select * from emp", con);con.Open();SqlDataReader dr = cmd. ExecuteReader (CommandBehavior. CloseConnection);//Implicitly closes the connection because CommandBehavior. CloseConnection wasspecified.
  8. 8. while(dr.Read()){Console.WriteLine (dr.GetString(0));}dr.Close();Reference:
  9. 9. AJAX Difference FAQs-11.Difference between AJAX and jQuery S.No AJAX jQuery 1 AJAX is a powerful tool which JQuery is a light weight language cannot use HTML since it is a that focuses the interaction in the simple tool and it can not HTML elements. reload the page after it is once loaded. 2 AJAX is a combination of JQuery cannot provide a new several technologies such as functionality by combining with CSS, HTML, DOM and many other technologies. more. In combination with these technologies, AJAX provides new functionalities. 3 AJAX should be accessed in a JQuery can be accessed through proper procedure to retrieve front-end therefore JQuery does data from the server. not require understanding of the complete procedure to setup a page. 4 Heavy usage of AJAX often There is no chance for overload of leads to the server overload server while using JQuery since due to more number of there is no such heavy usage in connections created. JQuery.2.Difference between AJAX and JavaScript S.No AJAX JavaScript 1 AJAX allows the coder send JavaScript is a client side scripting request data asynchronously in language that allows the creation of order load new data without dynamic web pages by providing a changing the web page. new level of interactivity. 2 AJAX supports the server side JavaScript provides support to the scripting Language. client side scripting language. 3 AJAX can load the web page JavaScript cannot load the pages after it is been loaded for the after it is once loaded. first time. 4 AJAX does not install Trojan in JavaScript can install Trojan in the the computer. computer.3.Difference between AJAX and PHP S.No AJAX PHP
  10. 10. 1 AJAX is an Asynchronous PHP is a Hypertext processor that JavaScript XML that has a is a general scripting language group of web technologies which produces dynamic web which are interrelated. pages. 2 AJAX is not a stand alone PHP is a stand alone technology. technology. AJAX is a group of technology. 3 AJAX needs a specific platform PHP can run on any platform and and operating system to run. operating system. 4 AJAX is difficult to develop on PHP is easy to develop on static static pages. pages. 5 AJAX will only run if the PHP is highly vulnerable and does browser supports JavaScript or not require much support. XMLHttpRequest.4.Difference between AJAX and DHTML S.No AJAX DHTML 1 AJAX does not have the DHTML makes a Button glow or feature of making the button pressed when the cursor is moved glow when the cursor is moved over it. over it. 2 AJAX can load a single link DHTML loads a fresh new page to instead of loading the whole load a link. new page. 3 AJAX saves the loading time. DHTML consumes more time than AJAX takes in loading the page. 4 AJAX permits the browser to DHTML does change the element request certain elements which on the screen depending on the reduces the strain on the request from the user. internet.Reference:
  11. 11. ASP.NET Difference FAQs 1. What are the differences between Inline code and Code Behind Code? S.No Inline code Code Behind Code 1 Its within .aspx file Its in a external class file 2 Dynamically compiled Compiled prior to deployment and linked with .aspx file 2. What are the differences between Global.asax and Web.Config? S.No global.asax web.config 1 It is a class file It is an XML file 2 There can be only one for an There can be many if under different application sub-folders 3 Can have Application and Cannot have Application and Session Session events events 4 Need to be recompiled when No need to compile when changes changes are made are made 3. What are the Differences between Server.Transfer and Response.Redirect? S.No Server.Transfer Response.Redirect 1 The navigation happens on the The navigation happens on the server-side ,so client history is client-side ,so client history is not updated updated 2 Data can be persist across the Context.Items loses the persistence pages using Context.Item collection 3 No Round-trips Makes a Round-trip 4 Has Good encapsulation No 4. What is the difference between a custom control and a user control? S.No User Control Custom Control 1 Is a file with the .ascx extension Is a file with the .dll extension 2 Can be only used with the Can be used in any number of application applications 3 Language dependent They are language independent, a control created in c# can be used in 4 Cannot be added to Visual studio Can be added to Visual studio Toolbox
  12. 12. Toolbox 5 Inherits from Server controls and We have to develop from scratch , easy to create so comparatively difficult 6 Generally used for static content Used when dynamic content is required 5. What is the difference between Caching and Application? S.No Caching Application 1 Cache have expire policy Application does not have expire policy 2 Cache does not require explicit Application require explicit locking locking 3 Cache has the Property of Application variables exist as long as timeout, which allows us to control the application is alive the duration of the Objects so cached 4 Output can be cached in 4 ways, Application does not have options as like Cache object • Page Output Caching • Page Partial Caching • DataSource Caching • Data Caching 5 It is accessible to page level to all It is accessible to both page level the users and application level to all the users 6. What is the difference between web farm and web garden? S.No Web farm Web garden 1 A web application running on A web application running on a single multiple servers is called a web server that has multiple CPUs is farm. called a web garden.The benefit of using this is, if one server crashes then other will work instantly. 2 For Web Garden, we have to use Web Farm is implemented using techniques like Net Work Load in Machine.Config file. Balancing.Summary:Web garden and web farms are applications that serve the purpose when theuser base of a web site increases considerably.For Web garden/Web Farm configurations, we have to set sessionState mode to
  13. 13. StateServer/SQLServer in the web.config file. 7. What is the difference between Application and Session Events? S.No Application Event Session Event 1 Application events are used to Session events are used to initialize objects and data that initialize data that we want to keep we do want to make available throughout individual sessions, but to all the current sessions of that we do not want to share our web application between sessions 8. What is the difference between Session Cookies and Persistent Cookies? S.No Session Cookies Persistent Cookies 1 Session Cookies do not have Persistent Cookies have an expiration expiration date date. The expiration date indicates to the browser that it should write the cookie to the client’s hard drive 9. What are the differences between Server Controls and HTML Controls? S.No Server Controls HTML Controls 1 Server Controls can trigger HTML Controls can trigger only control-specific events on the page-level events on server server (postback) 2 Data entered in a server control Data is not maintained in an HTML is maintained across requests. control. Data must be saved and Server controls retain state restored using page-level scripts 3 The Microsoft .NET Framework HTML controls have HTML provides a set of properties for attributes only each server control. Properties allows us to change the server control’s appearance and behavior within server-side code 4 Server controls automatically We must detect browser in code or detect browser and adapt write for least common denominator display as appropriate 10.What are the differences between ViewState and Hidden fields? S.No ViewState Hidden fields 1 This is used for pages that will This is used for pages that will postback to itself postback to itself or to another page 2 This is built in structure for This is not an inbuilt structure maintaining state of a page 3 Security is more as data is Security is less when compared to hashed, compressed and ViewState
  14. 14. encoded11.What is the difference between SQL Cache Notification and SQL Cache Invalidation? S.No SQL Cache Notification SQL Cache Invalidation 1 Using SQL Cache Notification, we Using SQL Cache Invalidation, we can generate notifications when can make a cached item invalid that the data of a database on which a depends on the data stored in a SQL cached item depends changes server database, when the data in the SQL server database is changed 12.What is the difference between absolute time expiration and sliding time expiration? S.No Absolute time expiration Sliding time expiration 1 In absolute time expiration, a In sliding time expiration, the time for cached item expires after the which the item is cached is each time expiration time specifies for it, incremented by its expiration time if it irrespective of how often it is is accessed before completion of its accessed expiration time13.What is the difference between adding items into cache through Add() method and Insert() method? S.No Cache.Add() Cache.Insert() 1 Cache.Add() method also returns Cache.Insert() method adds only the an object representing the item item in the cache we have added in the cache ,besides adding the item in the cache 2 It is not possible to replace an We can replace an existing item in the existing item in the cache using cache using the Cache.Insert() the Cache.Add() method method14.What is the difference between page-level caching and fragment caching? S.No Page-level caching Fragment caching 1 In Page-level caching, we cache In Fragment caching, we cache parts a whole page of the web page such as a user control added to the web page15.What is the difference between Label control and Literal control? S.No Label control Literal control 1 Final HTML code of a Label Final HTML code of a Literal control control has an HTML tag contains only text, which is not surrounded by any HTML tag16.What is the difference between HyperLink control and LinkButton control?
  15. 15. S.No HyperLink control LinkButton control 1 A HyperLink control do not have A LinkButton control have Click and Click and Command events Command events, which can be handled in the code behind file of the web page17.What is the difference between an HtmlInputCheckBox control and an HtmlInputRadioButton control? S.No HtmlInputCheckBox control HtmlInputRadioButton control 1 We can select more than one We can select only a single HtmlInputCheckBox control from HtmlInputRadioButton control from a a group of HtmlInputCheckBox group of HtmlInputRadioButton controls controls18.How a content page differs from a master page? S.No Content page Master page 1 A content page does not have A master page has complete HTML complete HTML source code source code inside its source file19.How will you differentiate a submaster page from a top-level master page? S.No Submaster page Top-level master page 1 Like a content page, a submaster Top-level master page has complete page also does not have HTML source code inside its source complete HTML source code file20.What is the difference between a page theme control and a global theme? S.No Page theme Global theme 1 A page theme is stored inside a A global theme is stored inside the subfolder of the App_Themes Themes folder on a web server folder of a web application 2 It can be applied to individual web It can be applied to all the web sites pages of the web application on the web server21.What is the difference between a default skin and a named skin? S.No Default skin Named skin 1 A default skin does not have a A named skin has a SkinId attribute SkinId attribute 2 It is automatically applied to all It is applied to a control explicitly by the controls of the same type setting the SkinId property of the present on a web page control from the Properties window22.Differentiate Globalization and Localization S.No Globalization Localization
  16. 16. 1 Globalization is the process of Localization is the process of identifying the specific portion of configuring a web application to be a web application that needs to supported for a specific language or be different for different locale languages and isolating that portion from the core of the web application 2 example: example: a)consider this tag in Web.Config we have 2 resource files: file. a) b)default.aspx.en-US.resx It would cause the dates to be displayed in French for the web Using appropriate coding in the page of the folder where this .aspx.cs files of a web page, the Web.Config file is located. strings written in these resource files can be used to change the text of the b) CultureInfo d=new strings dynamically. CultureInfo("de-DE"); Response.Write(DateTime.Now.T oString("D",d); It would display date in long format using German culture 23.What are the differences between web.config and machine.config? S.No web.config machine.config 1 This is automatically created This is automatically installed when when we create an ASP.Net web we install Visual Studio. Net application project 2 This is also called application This is also called machine level level configuration file configuration file 3 We can have more than one Only one machine.config file exists on web.config file a server 4 This file inherits setting from the This file is at the highest level in the machine.config configuration hierarchyReference: Difference FAQs-2Difference between Web site and Web application S.No Web site Web application 1 Can mix vb and c# page in We cant include c# and vb page single website. in single web application.
  17. 17. 2 Can not establish We can set up dependencies dependencies. between multiple projects.3 Edit individual files after Can not edit individual files after deployment. deployment without recompiling.4 Right choice when one Right choice for enterprise developer will responsible environments where multiple for creating and managing developers work unitedly for entire website. creating,testing and deployment. i.e.,In web site i.e.,In Web application, different development, decoupling is different groups work on various not possible. components independently like one group work on domain layer, other work on UI layer.5 Web site is easier to create Web application is more difficult than Web application to create than a Web siteDifference between Local storage and cookiesS.No Local storage Cookies1 Good to store large amount Good for small amount of data, up of data, up to 4MB to 4KB2 Easy to work with the Difficult to work with JavaScript JavaScript3 Local storage data is not All data is transferred to and from sent to the server on every server, so bandwidth is consumed request (HTTP header) as it on every request is purely at the client side4 No way to specify the time Can specify timeout period so that out period as the Cookies cookies data are removed from have browserDifference between Session and CacheS.No Session Cache1 Ssession retains state Cache is used for retaining state for per user application scoped items.2 Items put into a session Items in the cache can expire (will will stay there, until the be removed from cache) after a session ends specified amount of time. And also there is no guaranty that objects will not be removed before their expiration times as ASP.NET remove
  18. 18. items from cache when the amount of available memory gets small. This process is called as Scavenging.3 The session state can This is not the case with the cache. be kept external (state server, SQL server) and shared between several instances of our web app (for load balancing).Difference between Datalist and RepeaterS.No Datalist Repeater1 Datalist supports multiple Repeater doesnt support multiple columns displaying and columns display,no repeat columns using repeat columns property property2 Datalist supports styles Repeater does not provide styles for formating templates data[headerstyle,...]3 Datalist rendering Repeater performanace is better output[html content]will than Datalist be slow compare with repeater.Summary:If the requirement can achieve using repeater and datalist,choose repeater for betterperformanceReference: Difference FAQs-31.Difference between ASP.NET and PHP S.No ASP.NET PHP 1 Technology Availability: Technology Availability: ASP.NET was launched by PHP was launched by Rasmus Microsoft in the year 2002. Lerdorf in the year 1995. 2 Database: Database: ASP.Net uses MS-SQL for For point of database connectivity
  19. 19. connecting database but MS- PHP uses MySQL for the purpose SQL can not be availed free of database connectivitybecasue from Microsoft. its highly flexiblilty nature. Another important fact is that it will incurextra expenditure because MySQL can be accessed for free.3 Cost: Cost: We need to install Internet Information Server (IIS)on a Linux can be used for running PHP Windows server platformif you programs and Linux is free want to run ASP.Net program. operating system. Therefore,the As Windows server platform is cost of developing a website in not a free product,the cost of PHP language is remarkably low production is bounded to be increased.4 Run Time : Run Time: Whereas inbuilt memory space is It has been observed that used by PHP while running. ASP.Net code runs slower than PHP code. This is because ASP.Net utilizes server space while running5 Coding Simplicity: Coding Simplicity: PHP codes are very simple and a ASP.Net codes are somewhat programmer does not have to complicated and a web make a diligent effort because it is developer needs to work hard comparatively easier than other to get the hang of it types of programming languages.6 Platform Connectivity Issue : Platform Connectivity Issue: PHP has a unique advantage in ASP.NET codes are usually this issue. Its codes can be linked run on Windows platforms but with different types of platforms if you install ASP-Apache in such as Windows, Linux and UNIX. the server than it can run on Linux platform as well.7 Cost of Tools : Cost of Tools : There is no such free tools are PHP codes are available for free in available for ASP.Net. various forums and blogs as it is a open source software. Furthermore, some useful tools that can be used in PHP are also available for free8 The syntax of ASP.Net is more Language Support : or less similar to that of Visual basic syntax and this is all but The codes that are used in PHP
  20. 20. simple. are very much similar to that of C+ + language and its syntax resembles the syntax used in C and C++. Therefore, if you have a fair knowledge in C++ or C, you will not face any difficulty while coding PHP language. 9 Security : Security : ASP. Net is reputed for Though PHP can offer enough creating sophisticated measures for ensuring data techniques to ensure the security safety of confidential data.This is the reason why government organizations opt for ASP.Net.2.Difference between ASP and ASP.NET S.No ASP ASP.NET 1 ASP is a request response ASP.NET is a programming model model. that is event driven. 2 ASP code is an interpreted ASP.NET is a compiled CLR code language that is interpreted by that will be executed on the Server. the script engine. 3 HTML and the coding logic are The code and design logic is mixed in ASP. separated in ASP.NET. 4 To develop and debug ASP ASP.NET application can be application, there are very developed and debugged using limited tools. various tools including the leading Visual Studio .NET tool. 5 ASP has limited support to ASP.NET is a complete Object Object Oriented Programming Oriented Programming language. principles. 6 Session management and ASP.NET extends complete application state management support for session management is very limited in ASP. and application state management. 7 Error handling system is poor ASP.NET offers complete error in ASP. handling and exception handling services. 8 ASP does not offer any in-built In ASP.NET, data exchange is support for the XML. easily performed using XML support.
  21. 21. 9 Data source support is not fully Data source support is fully distributed in ASP. distributed in ASP.NET.3.Difference between ASP.NET and VB.NET S.No ASP.NET VB.NET 1 ASP.NET is web technology VB.NET is a language that is used that is used in building web in writing programs that are utilizing applications and websites. the ASP.NET framework. 2 ASP.NET is a server side VB.NET is a .NET programming technology that is language language. VB.NET is used to independent. Any .NET create ASP.NET web applications languages such as C#, or windows applications using VB.NET can be used to Visual Studio Windows Forms develop web applications Designer or mobile applications or through ASP.NET. console applications or applications for variety of other purposes. 3 ASP.NET is included within the VB.NET is not part of .NET .NET framework. framework. For example, ASP.NET For example, VB.NET is the code contains the text boxes and the that is written on various events of controls that can be dragged text boxes and controls to make and dropped into a web form. them function as per the requirement. 4 ASP.NET contains server VB.NET does not include server controls. controls. 5 ASP.NET can support all .NET VB.NET can support only scripting languages. languages.4.Difference between Java and .NET S.No Java .NET 1 JAVA is developed by ‘Sun .NET is developed by ‘Microsoft’. Microsystem‘ 2 JAVA is a programming .NET is a framework that supports language many programming languages like C#,ASP,VB. 3 In JAVA, JVM(Java Virtual In .NET CLR(common language Machine) execute the code Runtime) execute the code with and convert source code to two phase compilation. byte code.
  22. 22. 4 JAVA can run on any .NET can run only on windows/IIS. operating system5 But in JAVA it depends upon Although .NET support both explicit the programmer to destroy the and implicit garbage garbage memory. collection,especially,in .NET the garbage collector destroy the garbage value in an efficient manner as compared to JAVA.6 JDBC is used for database ADO .NET is use for database connection in JAVA connection in .NET.7 For java many third party .net has a standard development IDEs are available. IDE i.e. Microsoft Visual Studio8 But web application in java run Both windows and web on any operating system. applications can developed by .net but it will be more better to go for windows application with .NET . you can also go for web application with .NET but it will only hosted on windows server.9 Exception Handling in Java is Exception Handling in .NET is harder than .NET simpler than JAVA.10 JAVA uses bootclasspath for .NET uses GAC(Global Assembly completely trusted codes. Cache) and keep trusted assemblies.11 Java is less secure than .NET JAVA and .NET both have similar while providing security security goals. But .NET is more secure because of its simple and clean designs.12 Java JDBC which requires .Net due to disconnected data multiple round trips to data access through ADO.Net has high base. Hence, performance is level of performance against Java lesser than .NET JDBC13 Development is comparatively Due to Microsoft Visual Studio, slower. development is faster.14 Java applications development Microsoft Visual Studio installation can be done on even less requires higher configuration configuration computer system. system.15 Java can only communicate .Net is the platform itself for a with java programs multitude of languages. One can use C, C++ and VB to program upon .net. These programs interact
  23. 23. with each other using common methods. these common methods are defined by .Net, and are used by the programs to communicate with each other without worry about that language the program was written in. the machine running the program/s will need the .Net platform to be installed.Reference: Difference FAQs-41.Difference between HTTP and HTTPS S.No HTTP HTTPS 1 URL begins with “http://" in URL begins with “https://” in case of case of HTTP HTTPS. 2 HTTP is unsecured HTTPS is secured. 3 HTTP uses port 80 for HTTPS uses port 443 for communication communication. 4 HTTP operates at Application HTTPS operates at Transport Layer Layer. 5 No encryption is there in HTTP HTTPS uses encryption. 6 No certificates required in certificates required in HTTPS. HTTP 7 Most internet forums will HTTPS should be used in Banking probably fall into this category. Websites, Payment Gateway, Because these are open Shopping Websites, Login Pages, discussion forums, secured Emails (Gmail offers HTTPS by access is generally not default in Chrome browser) and required Corporate Sector Websites. For example: PayPal: Google AdSense:
  24. 24. 2.Difference between GET and POST methods S.No GET POST 1 Post Mechanism: Post Mechanism: GET request is sent via URL. Post request is sent via HTTP request body or we can say internally. 2 Form Default Method: Form Default Method: GET request is the default We have to specify POST method method. within form tag like 3 Security: Security: Since GET request is sent via Since Post request encapsulated URL, so that we can not use name pair values in HTTP request this method for sensitive data. body, so that we can submit sensitive data through POST method. 4 Length: Length: GET request has a limitation POST request has no major on its length. The good limitation. practice is never allow more than 255 characters. 5 Caching or Bookmarking: Caching or Bookmarking: GET request will be better for POST request is not better for caching and bookmarking. caching and bookmarking. 6 SEO: SEO: GET request is SEO friendly. POST request is not SEO friendly. 7 Data Type: Data Type: GET request always submits POST request has no restriction. data as TEXT. 8 Best Example: Best Example: SEARCH is the best example LOGIN is the best example for for GET request. POST request.
  25. 25. 9 HTTP Request Message HTTP Request Message Format: Format: 1 POST /path/script.cgi HTTP/1.0 1 GET /path/file.html? 2 From: SearchText=Interview_Questio 3 User-Agent: HTTPTool/1.0 n HTTP/1.0 4 Content-Type: application/x- 2 From: www-form-urlencoded 5 Content-Length: 8 3 User-Agent: HTTPTool/1.0 6 4 [blank line here] 7 Code=132Some comments on the limit on QueryString / GET / URL parameters Length:1. 255 bytes length is fine, because some older browser may not support more than that.2. Opera supports ~4050 characters.3. IE 4.0+ supports exactly 2083 characters.4. Netscape 3 -> 4.78 support up to 8192 characters.5. There is no limit on the number of parameters on a URL, but only on the length.6. The number of characters will be significantly reduced if we have special characters likespaces that need to be URLEncoded (e.g. converted to the %20).7. If we are closer to the length limit better use POST method instead of GET method.3.Difference between User Controls and Master Pages S.No User Controls Master Pages 1 Its extension is .ascx. Its extension is .Master. 2 Code file: .ascx.cs or .ascx.vb code file: .master.cs or .master.vb extension 3 A page can have more than Only one master page can be one User Controls. assigned to a web page 4 It does not contain It contains ContentPlaceHolder. Contentplaceholder and this makes it somewhat difficult in providing proper layout and alignment for large designs. 5 Suitable for small designs(Ex: More suitable for large designs(ex: logout button on every .aspx defining the complete layout of page.) .aspx page) 6 Register Tag is added when MasterPageFile attribute is added we drag and drop a user in the Page directive of the .aspx control onto the .aspx page. page when a Master Page is referenced in .aspx page. 7 Can be attached dynamically Can be referenced using using LoadControl Web.Config file also or dynamically method.PreInit event is not by writing code in PreInit event.
  26. 26. mandatory in their case for dynamic attachment.4.Difference between Build and Rebuild S.No Build Rebuild 1 A build compiles only the files A rebuild rebuilds all projects and and projects that have files in the solution irrelevant of changed. whether they have changed or not. 2 Build does not updates the Rebuild updates the xml- xml-documentation files documentation filesNote: Sometimes,rebuild is necessary to make the build successful. Because, Rebuildcleans Solution to delete any intermediate and output files, leaving only the project andcomponent files, from which new instances of the intermediate and output files can then bebuilt.5.Difference between generic handler and http handler S.No Generic Handler Http Handler 1 Generic handler has a handler http handler is required to be which can be accessed by url configured in web.config against with .ashx extension extension in web.config.It does not have any extension 2 Typical example of generic For http handler, page handler handler are creating which serves .aspx extension thumbnails of images request and give response.Reference: Difference FAQs-51.Difference between ViewState and SessionState S.No ViewState SessionState 1 View state is maintained in Session state is maintained in page level only. session level. 2 View state of one page is not Session state value is available in visible in another page.i.e., all pages within a user session.i.e.,
  27. 27. when user requests another The data will be no longer available page previous page data will if user close the browser or be no longer available. session timeout occurs. 3 View state information stored Session state information stored in in client only. server. 4 View state persist the values of Session state persist the data of particular page in the client particular user in the server. This (browser) when post back data available till user close the operation done. browser or session time completes. 5 View state used to persist Session state used to persist the page-instance-specific data. user-specific data on the server side.2.Difference between ViewState and ControlState S.No ViewState ControlState 1 ViewState can be disabled Control State cannot be disabled. 2 ViewState is implemented by Control State works even when using EnableViewState EnableViewState is off. property of a control to true. To use Control State (for example in a custom control) we have to override OnInit method,call RegisterRequiresControlState method in OnInit method and then override the SaveControlState and LoadControlState methods. 3 ViewState is used to maintain Control State is used for small data page-level state for large data only. eg: maintain clicked page number in a GridView even when EnableViewState is off3.Difference between SessionState and Cookies S.No SessionState Cookies 1 Session can store any type of Cookies can store only "string" data because the value is of datatype datatype of "object" 2 These are stored at Server They are stored at Client side side 3 Session are secured because Cookie is non-secure since stored
  28. 28. it is stored in binary in text format at client side format/encrypted form and it gets decrypted at server 4 Session is independent for Cookies may or may not be every client i.e individual for individual for every client every client 5 There is no limitation on size or Due to cookies network traffic will number of sessions to be used increase.Size of cookie is limited to in an application 40 and number of cookies to be used is restricted to 20. 6 For all conditions/situations we Only in few situations we can use can use sessions cookies because of no security 7 We cannot disable the We can disable cookies sessions.Sessions can be used without cookies also(by disabling cookies) 8 The disadvantage of session is Since the value is string there is no that it is a burden/overhead on security server 9 Sessions are called as Non- We have persistent and non- Persistent cookies because its persistent cookies life time can be set manuallyReference: Difference FAQs-61.Difference between DataGrid and GridView S.No DataGrid GridView 1 Sorting: In DataGrid code Sorting: In case of GridView no requires to handle the additional code required. SortCommand event and rebind grid required. 2 Paging: In DataGrid requires Paging: In case of GridView no code to handle the additional code required. It also PageIndexChanged event and supports customized appearance. rebind grid required. 3 Data binding: Like GridView Data binding: GridView can bind DataGrid cannot bind with new with new datasource control datasource control in ASP.NET 2.0.
  29. 29. 4 Updating data: DataGrid Updating data: GridView requires requires extensive code to little code. Code like exceptions update operation on data handling for database part. 5 Events: In DataGrid less Events: GridView supports events events supported as compared fired before and after database to GridView. updates.2.Difference between ListView and GridView S.No ListView GridView 1 Data Grouping: In-built Data Grouping: To provide this support for this functionality is functionality, we need to write provided. custom code. 2 Provide Flexible Layout: In- Provide Flexible Layout: To built support for this provide this functionality, we need functionality is provided. to write custom code 3 Insert: In-built support for this Insert: To provide this functionality, functionality is provided. we need to write custom code3.Difference between DataList and GridView S.No DataList GridView 1 Paging: To provide this Paging: In-built support for this functionality, we need to write functionality is provided. custom code. 2 Provide Flexible Layout: In- Provide Flexible Layout: To built support for this provide this functionality, we need functionality is provided. to write custom code 3 Update,Delete: To provide this Update,Delete: In-built support for functionality, we need to write this functionality is provided. custom code 4 Data Grouping: In-built Data Grouping: To provide this support for this functionality is functionality, we need to write provided. custom code. 5 Sorting:To provide this Sorting:In-built support for this functionality, we need to write functionality is provided.
  30. 30. custom code.4.Difference between Repeater and ListView S.No Repeater ListView 1 Paging: To provide this Paging: In-built support for this functionality, we need to write functionality is provided. custom code. 2 Data Grouping: To provide Data Grouping: In-built support for this functionality, we need to this functionality is provided. write custom code. 3 Insert: To provide this Insert: In-built support for this functionality, we need to write functionality is provided. custom code 4 Update,Delete: To provide this Update,Delete: In-built support for functionality, we need to write this functionality is provided. custom code 5 Sorting:To provide this Sorting:In-built support for this functionality, we need to write functionality is provided. custom code.5.Difference between Repeater and DataList S.No Repeater DataList 1 Repeater is template driven DataList is rendered as Table. 2 Repeater cannot automatically DataList can automatically generates columns from the generates columns from the data data source source 3 Row selection is not supported Row selection is supported by by Repeater DataList 4 Editing of contents is not Editing of contents is supported by supported by Repeater DataList 5 Arranging data items We can arrange data items horizontally or vertically is not horizontally or vertically in DataList supported by RepeaterReference:
  31. 31. ASP.NET Difference FAQs-71.Difference between trace and debug in .NET S.No Trace Debug 1 This class works only when This class works only when your your application build defines application build defines the the symbol TRACE. symbol DEBUG. 2 For tracing, you have to use For tracing, you have to use Trace.WriteLine statements. Debug.WriteLine statements. 3 Trace class is generally used You generally use debug classes at to trace the execution during the time of development of deployment of the application. application. 4 Trace class works in both Debug class works only in debug debug mode as well as release mode. mode. 5 Performance analysis can be Performance analysis cannot be done using Trace class. done using Debug class. 6 Trace runs in a thread that is Debug runs in the same thread in different from the Main Thread. which your code executes. 7 Trace is used during Testing Debug is used during Debugging Phase and Optimization Phase Phase of different releases.2.Difference between ASP and ASPX S.No ASP ASPX 1 The .asp is the file extension of The .aspx is the file extension of the classic ASP page. ASP.NET page. 2 ASP stands for Active Server ASPX is the acronym of Active Pages. Server Pages Extended. 3 The .asp file runs under the The .aspx file runs in a separate process space of inetinfo.exe, worker process called as which is an IIS process space. aspnet_wp.exe. 4 The .asp file can execute only The .aspx file can run on any in platforms of Microsoft platforms, be it Microsoft or not. technology. It cannot run in Hence .aspx file can be executed non-Microsoft platforms like in Apache Web Server as well. Apache Web Server. 5 The .asp file can be coded in The .aspx file can be coded using only two languages namely any .NET language including VBScript and Javascript. Both VB.NET, C#. Both VB.NET and C#
  32. 32. these languages are client side are Server Side Languages. languages. 6 In .asp file, the executable In .aspx file, the executable code code can be included outside a cannot be included outside a function scope where in the function scope where in the function is located inside the function is located inside the script script block marked as block marked as runat=server. runat=server. 7 In .asp file, a function can be In .aspx file, a function cannot be defined inside server side defined inside server side script script tags. tags. 8 In .asp file, all the directives In .aspx, the language directive will be placed in the page’s first must be enclosed within page line using <%@Page directive as <%@Page Language= Language= “Jscript” %> tag. “VB” %>3.Difference between thread and process S.No Thread Process 1 Threads share the address Processes have their own address. space of the process that created it. 2 Threads have direct access to Processes have their own copy of the data segment of its the data segment of the parent process process. 3 Threads can directly Processes must use interprocess communicate with other communication to communicate threads of its process with sibling processes. 4 Threads have almost no Processes have considerable overhead overhead 5 New threads are easily created New processes require duplication of the parent process. 6 Threads can exercise Processes can only exercise considerable control over control over threads of the same process child processes 7 Changes to the main thread Changes to the parent process (cancellation, priority change, does not etc.) may affect the behavior of affect child processes. the other threads of the process
  33. 33. Another good reference: between ASPX and ASCX S.No ASPX ASCX 1 ASP.NET Page uses the User Control uses the extension extension .aspx .ascx For eg: Default.aspx For eg: WebUserControl.ascx. 2 ASP.NET Page begin with a User Control begin with a Control Page Directive. Directive. For eg: For eg: <%@ Page Language="C#" <%@ Control Language="C#" AutoEventWireup="true" AutoEventWireup="true" CodeFile="Default.aspx.cs" CodeFile="WebUserControl.ascx.c Inherits="_Default" %> s" Inherits="WebUserControl" %> 3 Usercontrol code can be used We can not use webforms in in webforms usercontrol. 4 ASP.NET Page can be viewed User Control cannot be viewed directly in the Browser. directly in the browser. User Controls are added to WebPages and we view them by requesting a web page in our browser 5 ASP.NET page has HTML, User Control does not have a Body or Form element. HTML, Body or Form element.Reference: Difference FAQs-81.Difference between HTML Controls and ASP.NET Standard Controls S.No HTML Controls ASP.NET Standard Controls 1 All HTML Controls run at Client All ASP.NET Controls run at Server side side 2 Can be made to run at Server Can’t be made to run at Client side side by adding runat=”server” rather equivalent HTML code is attribute generated on Rendering 3 Rendering is NOT Required Rendering is Required 4 Execution is FAST Execution is SLOW
  34. 34. 5 Don’t contain any class for the Contains Separate class for each Controls Controls 6 Don’t support Object Oriented Supports Object Oriented Programming features Programming Features 7 Don’t provide STATE Provides STATE MANAGEMENT MANAGEMENT2.Difference between Response.Redirect and Server.Transfer S.No Response.Redirect Server.Transfer 1 Used to redirect to any Used to redirect to any webpage in webpage in any website current website only 2 Can be used to pass the Can’t be used to pass the required required values from Source values from Source Page to Target Page to Target Page while Page while redirecting redirecting 3 Execution is Slow Execution is Fast 4 Target page address appears Target page address doesn’t within the address bar appears within the address bar 5 Refreshing of the page doesn’t Refreshing of the page causes cause any error error3.Difference between ASP.NET and ASP.NET MVC S.No ASP.NET ASP.NET MVC 1 You need .NET framework to You need .NET framework & install ASP.NET. ASP.NET to Install MVC. 2 Supports Code behind page Supports both Code behind page coding & Inline coding coding & Inline coding but, we should not use code behind as a practice because view should not perform any logic. 3 Pages are called Pages Pages are called Views 4 There is a Life cycle for every There is tailored lifecycle of the page. page. By default you wont see the events when you create the Views but, you can add the Page Load event by in a script server tag. Again its not a good practice 5 We use Viewstate concept There is no Viewstate for view. extensively There is no state of the controls. But state of the entire page can be maintained by a feature
  35. 35. ModelBinders6 Every Page is inherited from Every Page is inherited from System.Web.UI.ViewPage System.Web.Mvc.ViewPage. View page is inherited from System.Web.UI.Page.7 You dont have the strongly You can create the Strongly typed typed pages Views using generics. It means, you can pass the object (Model) to the view page from the controller.8 Has lot of inbuilt Controls that We cannot use the ASP.NET support RAD. controls because they dont support the ViewState and Postback. We have inbuilt methods called HTML Helper methods. These methods just create the required HTML in the response stream. You can create the user controls.9 Has the limited control over the Since we have no controls and are HTML being generated by writing HTML we have control over various controls. the markup.10 Logic is not completely Logic is modularized in methods modularized in pages. called Action methods of the controller.11 Difficult to test the UI Logic MVC is designed to unit test using unit tests. every part of the application. It strongly supports the TDD approach.12 Doesnt support clean or Support clean or search engine search engine friendly friendly URLs URLs . ASP.NET 4 has the You can design to support the routing module or else REST based resources in we need to use URL rewrites. application13 Code behind supports only one Web request finally will reach aspect of separation of the controller. Requests never concerns. reach Views. Web user cannot identify a specific view on the server.14 Web requests are reached Web request finally will reach directly to the intended the controller. Requests never page. Web users can identify reach Views. Web user cannot the pages on the server. identify a specific view on the server.
  36. 36. 15 If you rename the web pages You dont need to change the URL, the URL is changed even if you change the Controller and the View.16 URLS are determined by the You have to define the URL folder structure of the pages formats which are called Routes. Framework will try to match the URL with all the defined routes in an order. Framework will hand over the request to the corresponding route Handler.17 Query string are used as small URLS formats drive the inputs to inputs to the pages the requests. You can also have querystrings18 Related Pages are separated Related Views are written under by folder controller. And for each controller we need to create a folder for all its views.19 We have ASP.NET AJAX MVC has some AJAX features but Framework and AJAX server internally it uses the ASP.NET side controls to support AJAX AJAX script libraries. So we have page development to manually include the libraries in the project. No support of AJAX Server side controls.20 File extensions in IIS are There are no file extensions for mapped to ASP.NET isapi dll MVC. If deployed in IIS7 Internally and in web.config they are it will use the MVC mapped to corresponding file UrlRoutingModule to route the HTTPHandlers. request to the MVC framework.21 All the Page requests are Each Route has the option to use a handled by PageFactory default Route handler or custom Handler. handler. So all the page requests are handled by Route handles.22 Its difficult to modify the Its designed to modify or replace internal behavior of the core the internal components. It ASP.NET components. supports the Plug-in structure Example: - ASPX Pages are used to render the HTML. You can configure to not to use ASP.NET pages and use different view engines. There are many view engines available in market or you can
  37. 37. create your own view engine.Reference: Between HttpHandler and HttpModuleDifference between HttpHandler and HttpModule S.No HttpHandler HttpModule 1 Meaning: Meaning: An ASP.NET HTTP handler is An HTTP module is an assembly the process (frequently that is called on every request that referred to as the "endpoint") is made to our application. HTTP that runs in response to a modules are called as part of the request made to an ASP.NET ASP.NET request pipeline and Web application. The most have access to life-cycle events common handler is an throughout the request. HTTP ASP.NET page handler that modules examine incoming and processes .aspx files. When outgoing requests and take action users request an .aspx file, the based on the request. request is processed by the page through the page handler. We can create our own HTTP handlers that render custom output to the browser.In order to create a Custom HTTP Handler,we need to Implement IHttpHandler interface(synchronous handler) or Implement IHttpAsyncHandler(asynchrono us handler). 2 RSS feeds: To create an RSS When to use HTTP modules: feed for a Web site, we can create a handler that emits Security: Because we can RSS-formatted XML. We can examine incoming requests, an then bind a file name extension HTTP module can perform custom such as .rss to the custom authentication or other security handler. When users send a checks before the requested page, request to your site that ends XML Web service, or handler is in .rss, ASP.NET calls our called. In Internet Information handler to process the request. Services (IIS) 7.0 running in Image server: If we want a Integrated mode, we can extend Web application to serve forms authentication to all content images in a variety of sizes, we types in an application. can write a custom handler to Statistics and logging: Because
  38. 38. resize images and then send HTTP modules are called on every them to the user as the request, we can gather request handler’s response. statistics and log information in a centralized module, instead of in individual pages. Custom headers or footers: Because we can modify the outgoing response, we can insert content such as custom header information into every page or XML Web service response.3 How to develop an ASP.NET How to develop a Http Module: handler: All we need is implementing All we need is implementing System.Web.IHttpModule interface. IHttpHandler interface public class MyHttpModule : public class MyHandler IHttpModule :IHttpHandler { { public void Dispose() public bool IsReusable { { get { return false; } } } public void Init(HttpApplication public void context) ProcessRequest(HttpContext { context) //here we have to define handler for { events such as BeginRequest ,PreRequestHandlerExecute } ,EndRequest,AuthorizeRequest } and .... } // you need to define event handlers here }4 Number of HTTP handler Number of HTTP module called: called: Whereas more than one HTTP During the processing of an modules may be called. http request, only one HTTP handler will be called.5 Processing Sequence: Processing Sequence: In the request pipe line In the request pipe line, ,http handler comes after http http Module comes first.
  39. 39. Module and it is the end point objects in ASP.NET pipeline. 6 What it does actually? What it does actually? HTTP Handler actually HTTP module can work on request processes the request and before and on the response after produces the response HTTP Handler 7 HTTP Handler implement Http Module implements following Methods and following Methods and Properties: Properties: Process Request: This InIt: This method is used for method is called when implementing events of HTTP processing requests. Modules in HTTPApplication Here you can perform all the object. things related to processing Dispose: This method is used request. perform cleanup before Garbage IsReusable: This property is to Collector destroy everything. determine whether same instance of HTTP Handler can be used to fulfill another request of same type. 8 Summary: Summary: If we need to create a request If we want to modify a certain handler, for example we may request, like we may want to want our own code to handle perform some custom logic behind all .jpg image file requests like: the scenes whenever user, requests pages like then we need to use, we need HttpHandlers for this purpose. to use HttpModules. We can create multiple HttpModules to filter any request.Reference: Difference FAQs-91.Difference between .NET Application Development and Traditional ApplicationDevelopment S.No .NET Application Traditional Application Development Development 1 Using .NET Framework, your Your program will be compiled into program will be compiled into an assembly language code that is an intermediate language very specific to the platform in representation called MSIL which you are running your
  40. 40. (Microsoft Intermediate application. Language). 2 MSIL code will not contain any Assembly language code will API calls specific to any contain API calls specific to the platform. current application platform. 3 This MSIL code is then This assembly language code is converted into machine code then converted into machine code. at runtime using CLR (Common Language Runtime). 4 Optimization is done at runtime Optimization is done by the by CLR. compiler itself at compile time. 5 The compiler used in this The compiler is not static. It process is static meaning that performs both compilation as well it checks only for syntax and as optimization. the necessary semantics. 6 Libraries used by your program Libraries used by your program are are linked even before linked only after generating the generating MSIL, but it is machine code. linked in an un-compiled form. This will be compiled by the compiler and it will be used by the CLR while executing the program. 7 The program will not directly Now the program is ready for call APIs of the operating execution by the operating system. system. Instead CLR will act The program will directly call APIs as a mediator. CLR will call of the operating system. APIs of operating system and the result of execution will be returned to program. 8 Automatic memory No automatic memory management and garbage management or garbage collection. collection is done by CLR. 9 .NET Framework Class Library No object oriented principles are provides object oriented incorporated. libraries.2.Difference between CSS and Themes S.No CSS Themes 1 Applies to all HTML Controls Applies to all the server controls 2 Is applied on the Client Side in Is applied on the server rather than the Browser in the browser
  41. 41. 3 We can apply multiple style But we cannot apply multiple sheets to a single page themes to a single page. Only one theme we can apply for a single page. 4 The CSS supports cascading But themes does not support cascading 5 The CSS cannot override the But any property values defined in property values defined for a a theme, the theme property control. overrides the property values declaratively set on a control, unless we explicitly apply by using the StyleSheetTheme property. 6 Cannot be Applied through the Can be Applied through configuration files Configuration Files. 7 Can be used directly via a All theme and Skin files should be reference to the css file placed in a special folder location called the “App_Themes” in order for the themes to work and behave normally. 8 Do not require any other Each theme should be associated resource like Skin files with at least one Skin file. 9 In case of CSS you can define But a theme can define multiple only style properties properties of a control not just style properties such as we can specify the graphics property for a control, template layout of a GridView control etc.3.Difference between Postback and Callback S.No Postback Callback 1 A Postback occurs when the A callback is also a special kind of data (the whole page) on the postback, but it is just a quick page is posted from the client round-trip to the server to get a to the the data is small set of data(normally), and posted-back to the server, and thus the page is not refreshed, thus the unlike with the postback. page is refreshed. 2 With Asp.Net, the ViewState is With Asp.Net, the ViewState is not refreshed when a postback is refreshed when a callback is invoked. invoked.
  42. 42. 3 A postback occurs when a A callback, generally used with request is sent from the client AJAX, to the server for the same occurs when a request is sent from page as the one the user is the currently viewing. When a client to the server for which the postback occurs, the entire page is not refreshed, only a part of page is refreshed and you can it is updated without any flickering see the typical progression on occurring on the browser. the progress bar at the bottom of the browser.4.Difference between Session.Clear() and Session.Abandon() S.No Session.Clear() Session.Abandon() 1 Session.Clear() just removes Session.Abandon() destroys the all values (content) from the session and the Session_End Object. The session with the event is triggered and in the next same key is still alive.It is just request, Session_Start will be fired. like giving value null to this session. 2 Use Session.Clear(), if we So, if we use Session.Abandon(), want user to remain in the we wil lose that specific session same session and we don not and we will get a new session key. want user to relogin or reset all We could use it for example when his session specific data. the user logs out.Reference: between ASP.Net 2.0 and ASP.Net 3.5Difference between ASP.Net 2.0 and ASP.Net 3.5 SNo Feature ASP.Net 2.0 ASP.Net 3.5 1 New Features ASP.Net 2.0 includes the ASP.Net 3.5 includes the following as new features, following as new features, 1. Master Pages 1. ListView Control 2. Profiles 2. DataPager Control 3. GridView Control 3. Nested Master Pages 4. LinqDataSource Control 2 Multi-targeting ASP.Net 2.0 does not ASP.Net 3.5 supports multi- support Multi-Targeting targeting. It means that we environment. choose from a drop-down list whether to have Visual Studio 2008 build applications against the ASP.NET 2.0, 3.0, or 3.5