Wednesday, February 2, 2011

Interview Questions

ASP.NET

Part IV

76. What is a profile object, why is it used?
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.

77. What is Configuration API?
ASP.NET 2.0 contains new configuration management APIs, enabling users to programmatically build programs or scripts that create, read, and update Web.config and machine.config configuration files.

78. What is MMC Admin Tool?
ASP.NET 2.0 provides a new comprehensive admin tool that plugs into the existing IIS Administration MMC, enabling an administrator to graphically read or change common settings within our XML configuration files.

79.Explain the use of Pre-compilation Tool?
ASP.NET 2.0 delivers a new application deployment utility that enables both developers and administrators to precompile a dynamic ASP.NET application prior to deployment. This precompilation automatically identifies any compilation issues anywhere within the site, as well as enables ASP.NET applications to be deployed without any source being stored on the server (one can optionally remove the content of .aspx files as part of the compile phase), further protecting your intellectual property. 

80.How is application management and maintenance improved in Asp.net 2.0?
ASP.NET 2.0 also provides new health-monitoring support to enable administrators to be automatically notified when an application on a server starts to experience problems. New tracing features will enable administrators to capture run-time and request data from a production server to better diagnose issues. ASP.NET 2.0 is delivering features that will enable developers and administrators to simplify the day-to-day management and maintenance of their Web applications.

81.What are Provider-driven Application Services? explain in detail?ASP.NET 2.0 now includes built-in support for membership (user name/password credential storage) and role management services out of the box. The new personalization service enables quick storage/retrieval of user settings and preferences, facilitating rich customization with minimal code. The new site navigation system enables developers to quickly build link structures consistently across a site. As all of these services are provider-driven, they can be easily swapped out and replaced with your own custom implementation. With this extensibility option, you have complete control over the data store and schema that drives these rich application services.

82.Explain Server Control Extensibility with reference to Asp.net 2.0 ?ASP.NET 2.0 includes improved support for control extensibility, such as more base classes that encapsulate common behaviors, improved designer support, more APIs for interacting with client-side script, metadata-driven support for new features like themes and accessibility verification, better state management, and more.

83.What are the Data Source Controls?Data access in ASP.NET 2.0 is now performed declaratively using data source controls on a page. In this model, support for new data backend storage providers can be easily added by implementing custom data source controls. Additionally, the SqlDataSource control that ships in the box has built-in support for any ADO.NET managed provider that implements the new provider factory model in ADO.NET.

84.What are Compilation Build Providers?Dynamic compilation in ASP.NET 2.0 is now handled by extensible compilation build providers, which associate a particular file extension with a handler that knows how to compile that extension dynamically at runtime. For example, .resx files can be dynamically compiled to resources, .wsdl files to web service proxies, and .xsd files to typed DataSet objects. In addition to the built-in support, it is easy to add support for additional extensions by implementing a custom build provider and registering it in Web.config.

85. What is Expression Builders, why would you use it?ASP.NET 2.0 introduces a declarative new syntax for referencing code to substitute values into the page, called Expression Builders. ASP.NET 2.0 includes expression builders for referencing string resources for localization, connection strings, application settings, and profile values. You can also write your own expression builders to create your own custom syntax to substitute values in a page rendering.

86. Is ASP.NET 64-Bit enabled? How?ASP.NET 2.0 is now 64-bit enabled, meaning it can take advantage of the full memory address space of new 64-bit processors and servers. Developers can simply copy existing 32-bit ASP.NET applications onto a 64-bit ASP.NET 2.0 server and have them automatically be JIT compiled and executed as native 64-bit applications (no source code changes or manual re-compile are required).

87. Explain how Caching in Asp.net 2.0 is different from Caching in Asp.net 1.1?ASP.NET 2.0 also now includes automatic database server cache invalidation. This powerful and easy-to-use feature allows developers to aggressively output cache database-driven page and partial page content within a site and have ASP.NET automatically invalidate these cache entries and refresh the content whenever the back-end database changes. Developers can now safely cache time-critical content for long periods without worrying about serving visitors stale data.

88. How to add client side event to server side? And how to register client script to sever side? Difference these two
We can register client script in serverside also....if u want to make it in serverside use this code...
ClientScript.RegisterStartupScript(Me.GetType (), "script", "<script language=""javascript"">function1() </script>")
(or)
Me.Page.RegisterClientScriptBlock("close", "<script language=javascript>javascriptcode......</script>")
I think there is no difference b/n those two....depending
upon the situatio we can use any of these....

89. What does the "EnableViewState" property do? Why would I want it on or off?
Enableviewstate propery is on for page or any control then it holding or catching or storing data in memory as well as client side hedden value. when u post back data remains in control or page.If Enableviewstate property false then data remove when
Post back.

90. How many types of cookies are there in .NET ?Two type of cookeies.
a) single valued eg request.cookies("UserName").value="dotnetquestion"
b)Multivalued cookies. These are used in the way collections are used example
request.cookies("CookieName")("UserName")="dotnetquestionViji"
request.cookies("CookieName")("UserID") = "interview"
91. What is Finalizer in .NET?. Define dispose and finalize.

Finalizer are the methods that helps in cleanup the code before object is garbage collected. This process is called finalization . There are two methods of finalizer Dispose and Finalize .There is little diffrenet between two of this method . When we call Dispose method is realse all the resources hold by an object as well as all the resources hold by the parent object.When we call Dispose method it clean managed as well as unmanaged resources.
Finalize method also cleans resources but finalize call dispose clears only the unmanaged resources because in finalization the garbage collecter clears all the object hold by managed code so finalization fails to prevent those one of method is used that is: GC.SuppressFinalize.

92. What is Viewstate? View state is used by the ASP.NET page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state.
State management is the process by which you maintain state and page information over multiple requests for the same or different pages.
Client-side options are:
* The ViewState property * Query strings * Hidden fields * Cookies Server-side options are:
* Application state * Session state * DataBase Use the View State property to save data in a hidden field on a page. Because ViewState stores data on the page, it is limited to items that can be serialized. If you want to store more complex items in View State, you must convert the items to and from a string.
ASP.NET provides the following ways to retain variables between requests:
Context.Handler object Use this object to retrieve public members of one Web form’s class from a subsequently displayed Web form.
Query strings Use these strings to pass information between requests and responses as part of the Web address. Query strings are visible to the user, so they should not contain secure information such as passwords.
Cookies Use cookies to store small amounts of information on a client. Clients might refuse cookies, so your code has to anticipate that possibility.
View state ASP.NET stores items added to a page’s ViewState property as hidden fields on the page.
Session state Use Session state variables to store items that you want keep local to the current session (single user).
Application state Use Application state variables to store items that you want be available to all users of the application.

93. What is ado.net ?
ADO.NET is the primary relational data access model for Microsoft .NET-based applications. It may be used to access data sources for which there is a specific .NET Provider,or, via a.NET Bridge Provider, for which there is a specific OLE DB Provider, ODBC Driver, or JDBC Driver.

94. What is EnabledViewState?
"EnableViewState" property - holds the state of the web control. View state holds the proprty details as a group of a particular web control. And can be sent via HTTPEnable view state must eb enableed for transfering throught he HTTP requests.If, the webserver control is using the database request, then it is advisable to make the Enable viewState = false, to improve the processor performance, cause the database will overide the state.

95. What is PostBack & Callback?
One technique that current ASP.NET 1.0/1.1 developers use to overcome this postback problem is to use the Microsoft XMLHTTP ActiveX object to send requests to server-side methods from client-side JavaScript. In ASP.NET 2.0, this process has been simplified and encapsulated within the function known as the Callback Manager.
The ASP.NET 2.0 Callback Manager uses XMLHTTP behind the scenes to encapsulate the complexities in sending data to and from the servers and clients. And so, in order for the Callback Manager to work, you need a web browser that supports XMLHTTP. Microsoft Internet Explorer is, obviously, one of them.

96. Diffrence between Viewstate and Session?
View State are valid mainly during postbacks and information is stored in client only. Viewstate are valid for serializable data only. Moreover Viewstate are not secured as data is exposed to client. although we canconfigure page directive and machine key to make view state encrypted.
Where in case of session this is user specific data that is stored in server memory . Session state is valid for any type of objects. We can take help of session through different web pages also.

97. Diffrence between DataReader and DataAdapter
DateReader is an forward only and read only cursor type if you are accessing data through DataRead it shows the data on the web form/control but you can not perform the paging feature on that record(because it's forward only type).Reader isbest fit to show the Data (where no need to work on data)
DataAdapter is not only connect with the Databse(through Command object) it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected Architecture of .NET show we can populate the records to the DataSet. where as Dataadapter is best fit to work on data.

98. Type of garbage collector?
There are two types of Garbage Collector
Managed garbage collector see we will declaring variable ,object in our programs once this kind of variable, object goes out of the scope ,they are put into the heap and they are checked for the further existence. once its being no longer used garbage collector will reallocate memory for that variable and objects.
Unmanaged garbage collector
This was done manually and u will be happen to open a connection with database, will be open the file etc. While this kind of the thing goes out of the scope we have to explicitly call the garage collector by calling the close command of the database once the connection is closed it puts this memory into the heap and process follows the same

99. How can we load multiple tables in to Dataset?
Write the select queries required in fill statement.
e.g.
Adp.Fill("Select * from Table1;Select * from Table2;Select * from Table3",DS)
This statement wil generate Dataset with 3 datatables.

100. what is the difference between serializable and MarshalByRefObject
In .net Remoting if ypu want your class to be participated in remoting it has to inherit from MarshalByRefObject class so that class definition can be passed by reference Where as [seraliazable] attribute is preceded before class that is can be seralized but this is used in conjuction with MarshalByValue class. Because when we pass by value then only we require this attribute.

No comments:

Post a Comment