Tuesday, July 9, 2013

What are different types of directives in .NET?

Tags
  • @Page
  • @Control
  • @Import
  • @Implements
  • @Register
  • @Assembly
  • @OutputCache
  • @Reference

What are the types of Authentication?

Tags
Introduction:
When you develop program for customers using ASP.Net, you must think about security. Security should be the one of the most priority components of any web application. Security is much important when you are developing a web application which is public and exposed to billion of users. Asp.net provides classes, structures and methods which ensure that the web application is more secure from any hacking or any outside attacks. Here we will go through the different types of authentications provided by ASP.Net. There is a web.config file in which you can set authentication mode 'forms' or windows'. We will see here the differences and how to you use them.
In dotnet four types of Authentication exists.

1)Windows,
2)Forms and
3)Passport Authentication.
4)Anonymous access

1)Windows authentication utilizes the security related features available into the Windows XP and Windows NT operating systems for authenticating and authorizing Web based applications users.

2)Forms authentication is the second type of authentication that allows you for creating your own database of users and also it validates the identity of those users whenever they open or visit your site.

3)Passport authentication is third authentication that uses the Microsoft centralized authentication provider for identifying visiters or users. This passport authentication provides an easy way for users to use a single identity over many Web based applications.

In order to use Passport authentication in your Web based application, you shoul install the Passport SDK.

4)Anonymous access You can explicitly disable authentication for your application if you know that it will be used only by anonymous users.




What is Authentication and Authorization?

Tags
Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password) and Authorization performs after authentication.
Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.

What is the difference between Custom Control and User Control?

Tags
Custom Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of web application add reference and use. Normally designed to provide common functionality independent of consuming Application.
User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.

What are the difference between Structure and Class?

Tags
  • Structures are value type and Classes are reference type
  • Structures can not have constructor or destructors.
  • Classes can have both constructor and destructors.
  • Structures do not support Inheritance, while Classes support Inheritance.

What is the difference between static or dynamic assemblies?

Tags
Assemblies can be static or dynamic.

Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files.

Dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

What is the difference between Server.Transfer and response.Redirect?

Tags
The Server.Transfer () method stops the current page from executing, and runs the content on the specified page, when the execution is complete the control is passed back to the calling page.
While the Response.Redirect () method transfers the control on the specified page and the control is never passed back to calling page after execution.

What is the difference between early binding and late binding?

Tags
Calling a non-virtual method, decided at a compile time is known as early binding. Calling a virtual method (Pure Polymorphism), decided at a runtime is known as late binding.

What is the difference between ASP Session State and ASP.Net Session State?

Tags
ASP session state relies on cookies, Serialize all requests from a client, does not survive process shutdown, Can not maintained across machines in a Web farm.