What Is Page Directives? What Is Master Page? What Is Design Pattern? What Is Adrotator?
What Is Page Directives? What Is Master Page? What Is Design Pattern? What Is Adrotator?
Following are the events occur during ASP.NET Page Life Cycle:
1)Page_PreInit
2)Page_Init
3)Page_InitComplete
4)Page_PreLoad
5)Page_Load
6)Page_LoadComplete
7)Page_PreRender
8)Page_PreRenderComplete
9)Page_Unload
-----------------------------------------------------------------------------------------------------------------
Q. How many types of authentication is there in ASP.NET
-------------------------------------------------------------------------------------------------------------------
Q2. How we can set Different levels of Authentication in .Net? What are the difference between
Windows Authenticatin, Passport Authentication and Form Authentication?
Windows authentication enables you to identify users without creating a custom page.
Credentials are stored in the Web server s local user database or an Active Directory domain.
Once identified you can use the user s credentials to gain access to resources that are protected
by Windows authorization.
Forms authentication enables you to identify users with a custom database such as an
ASP.NET membership database. Alternatively you can implement your own custom database.
Once authenticated you can reference the roles the user is in to restrict access to portions of your
Web site.
------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------
--------
Application Object and Cached Object both falls under Server side State Management.
Application variables exist as long as the application is alive. Whereas the cache has the Property
of timeout which allows us to control the duration of the Objects so cached.
Another usefulness in caching is that we can define the way we cache our output since caching
can be done in 3 ways -
a) Full Page - defined in page directrive
b) Partial Page - Eg - .ascx control
c) Data / Programatic caching. using the Properties of Cache object such as Cache.Insert .
NOTE:
Caching variable is specifc to page and time out
Application variable is the global variable specific to application
-----------------------------------------------------------------------------------------------------------------
Imports Microsoft.VisualBasic
Imports System.Collections
Imports System.Collection.Generic
Imports System.Data
Imports System.Data.sqlClient
While myreader.Read()
returnData.Add(myReader(CompanyName).ToString())
EndWhile
return returnData
EndFunction
EndClass
For Insert use ExecuteNonQuery in place of ExecuteReader
---------------------------------------------------------------------------------------------------------------------------------
-------------------------------
--------------------------------
What is JIT and how is works ?
An acronym for "just-in-time," a phrase that describes an action that is taken
only when it becomes necessary, such as just-in-time compilation or just-intime
object activation
--------------------------------------
What is difference between constants, readonly and, static ?
Constants: The value can’t be changed
Read-only: The value will be initialized only once from the constructor of the
class.
Static: Value can be initialized once.
-----------------------------------------
What are the types of authentication in .net?
We have three types of authentication:
1. Form authentication
2. Windows authentication
3. Passport
This has to be declared in web.config file.
--------------------------------------------
How do you initiate a string without escaping each backslash?
Put an @ sign in front of the double-quoted string.
---------------------------------------------
Explain encapsulation ?
The implementation is hidden, the interface is exposed.
------------------------------------------------
How do you convert a string into an integer in .NET?
Int32.Parse(string)
--------------------------------------------------
What's the advantage of using System.Text.StringBuilder over
System.String?
StringBuilder is more efficient in the cases, where a lot of manipulation is
done to the text. Strings are immutable, so each time it's being operated on,
a new instance is created.
-------------------------------------------------------
What's the difference between the System.Array.CopyTo() and
System.Array.Clone()?
The first one performs a deep copy of the array, the second one is shallow.
-----------------------------------------------------------
How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
-------------------------------------------------------
What's a delegate?
A delegate object encapsulates a reference to a method. In C++ they were
referred to as function pointers.
-----------------------------------------------
What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken
or missing data, proper handling), exception test
cases (exceptions are thrown and caught properly).
---------------------------------------------------
What's the top .NET class that everything is derived from?
System.Object.
----------------------------------------------------
How's method overriding different from overloading?
When overriding, you change the method behavior for a derived class.
Overloading simply involves having a method with the same name within the
class.
---------------------------------------------------
What does the keyword virtual mean in the method definition?
The method can be over-ridden.
--------------------------------------------
Can you declare the override method static while the original method
is non-static?
No, you can't, the signature of the virtual method must remain the same,
only the keyword virtual is changed to keyword override.
--------------------------------------------
Can you override private virtual methods?
No, moreover, you cannot access private methods in inherited classes, have
to be protected in the base class to allow any sort of access.
--------------------------------------------------
Can you prevent your class from being inherited and becoming a
base class for some other classes?
Yes, that's what keyword sealed in the class definition is for. The developer
trying to derive from your class will get a message: cannot inherit from
Sealed class WhateverBaseClassName. It's the same concept as final class in
Java.
--------------------------------------------------
Can you allow class to be inherited, but prevent the method from
being over-ridden?
Yes, just leave the class public and make the method sealed.
---------------------------------------------
Why can't you specify the accessibility modifier for methods inside
the interface?
They all must be public. Therefore, to prevent you from getting the false
impression that you have any freedom of choice, you are not allowed to
specify any accessibility, it's public by default.
---------------------------------------------------
What's an abstract class?
A class that cannot be instantiated. An abstract class is a class that must be
inherited and have the methods overridden. An abstract class is essentially a
blueprint for a class without any implementation.
--------------------------------------------------
What's an interface?
It's an abstract class with public abstract methods all of which must be
implemented in the inherited classes.
-------------------------------------------------
What's the difference between an interface and abstract class?
In the interface all methods must be abstract, in the abstract class some
methods can be concrete. In the interface no accessibility modifiers are
allowed, which is ok in abstract classes.
---------------------------------------
What is GAC?
Global Assembly Cache in .NET Framework acts as the central place for
registering assemblies. GAC is used to avoid the DLL Hell problem. To avoid the
name conflict “Strong name” is used with each and every assembly to store
them GAC. Global Assembly Cache contain following components
a. Assembly name
b. Assembly version
c. Culture info
d. Public Key
“Sn.exe” is used to create the strong name of an assembly. Gacutill Tool
used to store the assembly into GAC.
GAC is located under :\Windows\Assembly folder
-----------------------------------------------------------------------------
What is sealed class?
Sealed class is a class which can’t inherited any more. “Sealed” keyword is used
to make class Sealed. So, once we define a class using Sealed that can’t be
inherited.
}
--------------------------------------------------------------------------------
How is .NET able to support multiple languages?
- a language should comply with the Common Language Runtime standard to
become a .NET language. In .NET, code is compiled to Microsoft Intermediate
Language (MSIL for short). This is called as Managed Code. This Managed code is
run in .NET environment. So after compilation to this IL the language is not a
barrier. A code can call or use a function written in another language.
------------------------------------------------------------------------------
What is smart navigation?
- The cursor position is maintained when the page gets refreshed due to the
server side validation and the page gets refreshed.
---------------------------------------------------------------------------------
What is ADO .NET and what is difference between ADO and ADO.NET?
- ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-
memory database where in I can use relationships between the tables and select
insert and updates to the database. I can update the actual database as a batch.
----------------------------------------------------------------------------------
How do you separate business logic while creating an ASP.NET
application?
-use code behind (general answer)
----------------------------------------------------------------------------------
What are the XML files that are important in developing an ASP.NET
application?
-Web.config is the most important. Specific configuration determines which
others might be important.