ASP.NET Interview Questions

In ASP.Net 2.0 Login controls if you want to have your own database for login info how do you do that?
Create Table User with fields (UserID Primary Key, UserName,Password),Roles(RoleID Primary Key,RoleName) and UserRoles(id Primary Key, UserID Foreigh Key,RoleID Foreign Key).Populate the above tables with data. You can authenticate users based on roles from now by simply configuring web.config file.

What are the main differences between 1.1 and 2.0
ASP.NET 2.0 introduces a lot of new features. Some of this features aim to simplify the problems faced using the earlier versions and some features are introduced to provide lot of new facilities. The most important features that are incorporated in ASP.NET 2.0 are:

Master Page:
Master pages are introduced to remove one of the most important deficiencies of earlier version of ASP.NET. One thing that has become apparent in the earlier version of ASP.NET is the lack of architecture for applying a consistent look and feel. In earlier version of ASP.NET whenever a developer wants to replicate a common functionality of a web page in other pages, the most possible options he uses is creating a user control and then replicate the functionality in other pages. ASP.NET 2.0 aims to solve this problem by introducing the concept of Master pages. First the developer needs to define a master page containing the content that he wants to appear on other pages and then use the ContentPlaceHolder controls to define the locations where the sub pages can plug in the content of their own.

By default, ASP.NET web pages and code files are compiled dynamically when a first request is made to the page. After the initial compilation, the compiled pages is cached; the cache is used to satisfy the subsequent requests for the same page. Even though this approach is flexible, when the page is requested for the first time, it requires a bit of extra time to compile the code. You can avoid this overhead by leveraging a new feature known as precompilation; by using this feature, you can compile an ASP.NET web site before making the web site available to the users.

Sharing code in the application:
In earlier version of ASP.NET, if you were to reference a reusable component from your dot net application, you had to compile the assembly and place it in the bin folder (or place it in the GAC) of the web application. But now with ASP.NET 2.0, creating a reusable component is very simple and straightforward. All you need to do is to create a component in a pre-defined subdirectory called code. Any component placed in this directory will be automatically compiled at runtime into a single assembly. This assembly is automatically referenced and will be available to all the page in the site.

Themes and Skins:
ASP.NET 2.0 introduces the concepts of Themes and Skins by means of which the look and feel of the web pages can be enhanced to a great extent to make them visually catchy and attractive. A skin is a set of visual attributes applied to a control type. A theme is a collection of skins. There are a lot of predefined themes in ASP.NET 2.0. One can use it by using the following line of code:< @ Page Theme=”SmokeAndGlass” %> The page directive’s Them attribute declaratively applies a theme to a page. Themes can also be applied programmatically using the page class’s Theme property

what are the new features in ASP.NET 2.0?
ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. The first version of ASP.NET offered several important advantages over previous Web development models. ASP.NET 2.0 improves upon that foundation by adding support for several new and exciting features in the areas of developer productivity, administration and management, extensibility, and performance

New Server Controls:
ASP.NET 2.0 introduces many new server controls that enable powerful declarative support for data access, login security, wizard navigation, menus, treeviews, portals, and more. Many of these controls take advantage of core application services in ASP.NET for scenarios like data access, membership and roles, and personalization.

Master Pages:
This feature provides the ability to define common structure and interface elements for your site, such as a page header, footer, or navigation bar, in a common location called a "master page", to be shared by many pages in your site. In one simple place you can control the look, feel, and much of functionality for an entire Web site. This improves the maintainability of your site and avoids unnecessary duplication of code for shared site structure or behavior.

Themes and Skins.
The themes and skins features in ASP.NET 2.0 allow for easy customization of your site's look-and-feel. You can define style information in a common location called a "theme", and apply that style information globally to pages or controls in your site. Like Master Pages, this improves the maintainability of your site and avoid unnecessary duplication of code for shared styles.

Using the new personalization services in ASP.NET 2.0 you can easily create customized experiences within Web applications. The Profile object enables developers to easily build strongly-typed, sticky data stores for user accounts and build highly customized, relationship based experiences. At the same time, a developer can leverage Web Parts and the personalization service to enable Web site visitors to completely control the layout and behavior of the site, with the knowledge that the site is completely customized for them. Personalizaton scenarios are now easier to build than ever before and require significantly less code and effort to implement.

Enabling globalization and localization in Web sites today is difficult, requiring large amounts of custom code and resources. ASP.NET 2.0 and Visual Studio 2005 provide tools and infrastructure to easily build Localizable sites including the ability to auto-detect incoming locale's and display the appropriate locale based UI. Visual Studio 2005 includes built-in tools to dynamically generate resource files and localization references. Together, building localized applications becomes a simple and integrated part of the development experience.

Administration and Management
New tools like Configuration API, ASP.NET MMC Admin Tool, Pre-compilation Tool, Health Monitoring and Tracing have been introduced.

Do I need IIS to run Web applications?
If you are using Visual Studio, you can use the ASP.NET Development Server built into Visual Studio to test your pages. The server functions as a local Web server, running ASP.NET Web pages in a manner virtually identical to how they run in IIS. To deploy a Web application, you need to copy it to a computer running IIS version 5 or 6.

Can I upgrade my existing ASP.NET 1.x website to ASP.NET 2.0?
Yes. You can either login to the Customer Control panel and select ASP.NET 2.0 for your website.
Can I run my ASP.NET 2.0 applications on my local machine to test my pages?
If you are using Visual Studio, you can use the ASP.NET Development Server built into Visual Studio to test your pages. The server functions as a local Web server, running ASP.NET Web pages in a manner virtually identical to how they run on a Web server. Once testing is completed you can upload your pages to our servers.

Can I hide the source code for my page?
Server-side code is processed on the server and is not sent to the browser, so users cannot see it. However, client script is not protected; any client script that you add to your page or that is injected into the page by server processing is visible to users. If you are concerned about protecting your source code on the server, you can precompile your site and deploy the compiled version.

Are old projects created in Visual Studio .NET 2002 or 2003 supported in Visual Studio 2005?
Old projects will continue to run without change. In Visual Studio 2005, if you open a project created in Visual Studio .NET 2002 or 2003, the project is converted to the new project layout used in Visual Studio 2005. As part of the conversion, pages that use the old code-behind model are converted to use the new code-behind model. You cannot create pages using the old code-behind model in Visual Studio 2005.

No comments: