ASP.NET Difference FAQS by umarali1981


More Info
									1) What is the difference between Convert.ToInt32(string) and

  S.N   Int32.Parse(string)            Convert.ToInt32(string)
  1     It throws an exception when    It returns zero when null value is
        null value is passed           passed

2) What is the difference between EVAL and BIND?

  S.N   EVAL                           BIND
  1     It is readonly                 It is editable
  2     Used to display only           Used to both display and update

3) What is the main difference between MVP and MVC?

  S.N   MVP                            MVC
  1     In MVP, the View is            In MVC,the Controller and the
        completely controlled by the   Model can update the View

4) What are the differences between Inline code and Code Behind

  S.N   Inline code                    Code Behind Code
  1     Its within .aspx file          Its in a external class file
  2     Dynamically compiled           Compiled prior to deployment
                                       linked with .aspx file

5) What are the differences between Global.asax and

  S.N   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
        application                    different sub-folders
  3     Can have Application and       Cannot have Application and
        Session events                 Session events
  4     Need to be recompiled when     No need to compile when
        changes are made               changes are made
6) What are the Differences between Server.Transfer and

  S.N   Server.Transfer                 Response.Redirect
  1     The navigation happens on       The navigation happens on the
        the server-side ,so client      client-side ,so client history is
        history is not updated          updated
  2     Data can be persist across      Context.Items loses the
        the pages using Context.Item    persistence
  3     No Round-trips                  Makes a Round-trip
  4     Has Good encapsulation          No

7) What is the difference between a custom control and a user

  S.N   User Control                    Custom Control
  1     Is a file with the .ascx        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       Can be added to Visual studio
        studio Toolbox                  Toolbox
  5     Inherits from Server controls   We have to develop from
        and easy to create              scratch ,
                                        so comparatively
  6     Generally used for static       Used when dynamic content is
        content                         required

8) What is the difference between Caching and Application?

  S.N   Caching                         Application
  1     Cache have expire policy        Application   does not have expire
  2     Cache does not require          Application   require explicit
        explicit locking                locking
  3     Cache has the Property of       Application   variables exist as
        timeout, which allows us to     long as the   application is alive
        control the duration of the
         Objects so cached
   4     Output can be cached in 4        Application does not have
         ways,                            options as like Cache object
              • Page Output Caching
              • Page Partial Caching
              • DataSource Caching
              • Data Caching
   5                                It is accessible to both page
         It is accessible to page level
         to all the users           level and application level to all
                                    the users
9) What is the difference between web farm and web garden?

   S.N   Web farm                         Web garden
   1     A web application running on     A web application running on a
         multiple servers is called a     single server that has multiple
         web farm                         CPUs is called a web garden

10)     What is the difference between Application and Session

   S.N   Application Event                Session Event
   1     Application events are used      Session events are used to
         to initialize objects and data   initialize data that we want to
         that we do want to make          keep throughout individual
         available to all the current     sessions, but that we do not
         sessions of our web              want to share between sessions

11)      What is the difference between Session Cookies and
   Persistent Cookies?

   S.N   Session Cookies                  Persistent Cookies
   1     Session Cookies do not have      Persistent Cookies have an
         expiration date                  expiration date. The expiration
                                          date indicates to the browser
                                          that it should write the cookie to
                                          the client’s hard drive

12)    What are the differences between Server Controls and
   HTML Controls?

   S.N   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       Data is not maintained in an
         control is maintained across   HTML control. Data must be
         requests. Server controls      saved and restored using page-
         retain state                   level scripts
   3     The Microsoft .NET             HTML controls have HTML
         Framework provides a set of    attributes only
         properties for each server
         control. Properties allows us
         to change the server
         control’s appearance and
         behavior within server-side
   4     Server controls automatically We must detect browser in code
         detect browser and adapt       or write for least common
         display as appropriate         denominator
13)      What are the differences between ViewState and Hidden

   S.N   ViewState                        Hidden fields
   1     This is used for pages that      This is used for pages that will
         will postback to itself          postback to itself or to another
   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
         hashed, compressed and           to ViewState

14)     What is the difference between SQL Cache Notification
   and SQL Cache Invalidation?

   S.N   SQL Cache Notification           SQL Cache Invalidation
   1     Using SQL Cache                  Using SQL Cache Invalidation, we
         Notification, we can generate    can make a cached item invalid
         notifications when the data of   that depends on the data stored
         a database on which a            in a SQL server database, when
         cached item depends              the data in the SQL server
         changes                          database is changed

15)      What is the difference between absolute time expiration
   and sliding time expiration?
  S.N   Absolute time expiration           Sliding time expiration
  1     In absolute time expiration, a     In sliding time expiration, the
        cached item expires after the      time for which the item is cached
        expiration time specifies for      is each time incremented by its
        it, irrespective of how often it   expiration time if it is accessed
        is accessed                        before completion of its
                                           expiration time

16)     What is the difference between adding items into cache
   through Add() method and Insert() method?

  S.N   Cache.Add()                        Cache.Insert()
  1     Cache.Add() method also            Cache.Insert() method adds only
        returns an object                  the item in the cache
        representing the item we
        have added in the cache
        ,besides adding the item in
        the cache
  2     It is not possible to replace      We can replace an existing item
        an existing item in the cache      in the cache using the
        using the Cache.Add()              Cache.Insert() method

17)     What is the difference between page-level caching and
   fragment caching?

  S.N   Page-level caching                 Fragment caching
  1     In Page-level caching, we          In Fragment caching, we cache
        cache a whole page                 parts of the web page such as a
                                           user control added to the web

18)     What is the difference between Label control and Literal

  S.N   Label control                      Literal control
  1     Final HTML code of a Label         Final HTML code of a Literal
        control has an HTML tag            control contains only text, which
                                           is not surrounded by any HTML
19)     What is the difference between HyperLink control and
   LinkButton control?

  S.N   HyperLink control               LinkButton control
  1     A HyperLink control do not      A LinkButton control have Click
        have Click and Command          and Command events, which can
        events                          be handled in the code behind
                                        file of the web page

20)     What is the difference between an HtmlInputCheckBox
   control and an HtmlInputRadioButton control?

  S.N   HtmlInputCheckBox               HtmlInputRadioButton
  o     control                         control
  1     We can select more than one     We can select only a single
        HtmlInputCheckBox control       HtmlInputRadioButton control
        from a group of                 from a group of
        HtmlInputCheckBox controls      HtmlInputRadioButton controls

21)     How a content page differs from a master page?

  S.N   Content page                    Master page
  1     A content page does not         A master page has complete
        have complete HTML source       HTML source code inside its
        code                            source file

22)      How will you differentiate a submaster page from a top-
   level master page?

  S.N   Submaster page                  Top-level master page
  1     Like a content page, a          Top-level master page has
        submaster page also does        complete HTML source code
        not have complete HTML          inside its source file
        source code

23)      What is the difference between a page theme control and
   a global theme?

  S.N   Page theme                      Global theme
  1     A page theme is stored inside   A global theme is stored inside
        a subfolder of the              the Themes folder on a web
        App_Themes folder of a web      server
  2     It can be applied to individual   It can be applied to all the web
        web pages of the web              sites on the web server

24)    What is the difference between a default skin and a
   named skin?

  S.N   Default skin                      Named skin
  1     A default skin does not have      A named skin has a SkinId
        a SkinId attribute                attribute
  2     It is automatically applied to    It is applied to a control explicitly
        all the controls of the same      by setting the SkinId property of
        type present on a web page        the control from the Properties

25)     Differentiate Globalization and Localization

  S.N   Globalization                     Localization
  1     Globalization is the process of   Localization is the process of
        identifying the specific          configuring a web application to
        portion of a web application      be supported for a specific
        that needs to be different for    language or locale
        different languages and
        isolating that portion from
        the core of the web

26)     What are the differences between web.config and

  S.N   web.config                        machine.config
  1     This is automatically created     This is automatically installed
        when we create an ASP.Net         when we install Visual Studio.
        web application project           Net
  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
        web.config file                   exists on a server
  4     This file inherits setting from   This file is at the highest level in
        the machine.config                the configuration hierarchy

To top