POST-TITLE-HERE

Posted by Author On Month - Day - Year

POST-SUMMARY-HERE

POST-TITLE-HERE

Posted by Author On Month - Day - Year

POST-SUMMARY-HERE

POST-TITLE-HERE

Posted by Author On Month - Day - Year

POST-SUMMARY-HERE

POST-TITLE-HERE

Posted by Author On Month - Day - Year

POST-SUMMARY-HERE

POST-TITLE-HERE

Posted by Author On Month - Day - Year

POST-SUMMARY-HERE

.Net Interview Questions With Answers

Posted by Sweet Heart On 1:07 PM
Questions ASP.Net

Q-1:- Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
Ans:-inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things. When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe.

Q2:-What’s the difference between Response.Write() and Response.Output.Write()?
Ans:-Response.Output.Write() allows you to write formatted output.

Q3:-What methods are fired during the page load?
ANS:-Init() - when the page is instantiated
Load() - when the page is loaded into server memory
PreRender() - the brief moment before the page is displayed to the user as HTML
Unload() - when page finishes loading.

Q4:-When during the page processing cycle is ViewState available?
ANS:-After the Init() and before the Page_Load(), or OnLoad() for a control.

Q5:-What namespace does the Web page belong in the .NET Framework class hierarchy?
ANS:-System.Web.UI.Page

Q6:-Where do you store the information about the user’s locale?
ANS:-System.Web.UI.Page.Culture

Q7:-What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
ANS:-CodeBehind is relevant to Visual Studio.NET only.

Q8:-What’s a bubbled event?
ANS:-When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

Q9:-Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
ANS:-Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");

Q10:-What data types do the RangeValidator control support?
ANS:-Integer, String, and Date.

Q11:-Explain the differences between Server-side and Client-side code?
ANS:-Server-side code executes on the server. Client-side code executes in the client's browser.

Q12:-What type of code (server or client) is found in a Code-Behind class?
ANS:-The answer is server-side code since code-behind is executed on the server. However, during the code-behind's execution on the server, it can render client-side code such as JavaScript to be processed in the clients browser. But just to be clear, code-behind executes on the server, thus making it server-side code.

Q13:-Should user input data validation occur server-side or client-side? Why?
ANS:- user input data validation should occur on the server at a minimum. Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.

Q14:-What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
ANS:-Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not update the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another page or site. This performas a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address.

Q15:-Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Valid answers are:
ANS:-A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
A DataSet is designed to work without any continuing connection to the original data source.
Data in a DataSet is bulk-loaded, rather than being loaded on demand.
There's no concept of cursor types in a DataSet.
DataSets have no current record pointer You can use For Each loops to move through the data.
You can store many edits in a DataSet, and write them to the original data source in a single operation.
Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

Q16:-What is the Global.asax used for?
ANS:-The Global.asax (including the Global.asax.cs file) is used to implement application and session level events.

Q17:-What are the Application_Start and Session_Start subroutines used for?
ANS:-This is where you can set the specific variables for the Application and Session objects.

Q18:-Can you explain what inheritance is and an example of when you might use it?
ANS:-When you want to inherit (use the functionality of) another class. Example: With a base class named Employee, a Manager class could be derived from the Employee base class.

Q19:-Whats an assembly?
ANS:-Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN


Q20:-Describe the difference between inline and code behind.
ANS:-Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page.

Q21:-Explain what a diffgram is, and a good use for one?
ANS:-The DiffGram is one of the two XML formats that you can use to render DataSet object contents to XML. A good use is reading database data to an XML file to be sent to a Web Service.

Q22:-Whats MSIL, and why should my developers need an appreciation of it if at all?
ANS:-MSIL is the Microsoft Intermediate Language. All .NET compatible languages will get converted to MSIL. MSIL also allows the .NET Framework to JIT compile the assembly on the installed computer.

Q23:-Which method do you invoke on the DataAdapter control to load your generated dataset with data?
ANS:-The Fill() method.

Q24:-Can you edit data in the Repeater control?
ANS:-No, it just reads the information from its data source.

Q25:-Which template must you provide, in order to display data in a Repeater control?
ANS:-ItemTemplate.

Q26:-How can you provide an alternating color scheme in a Repeater control?
ANS:-Use the AlternatingItemTemplate.

Q27:-What property must you set, and what method must you call in your code, in order to bind the data from a data source to the Repeater control?
ANS:-You must set the DataSource property and call the DataBind method.

Q28:-What base class do all Web Forms inherit from?
ANS:-The Page class.

Q29:-Name two properties common in every validation control?
ANS:-ControlToValidate property and Text property.

Q30:-Which property on a Combo Box do you set with a column name, prior to setting the?
ANS:-DataSource, to display data in the combo box?
DataTextField property.

Q31:-Which control would you use if you needed to make sure the values in two different controls matched?
ANS:-CompareValidator control.

Q32:-How many classes can a single .NET DLL contain?
ANS:-It can contain many classes.



Web Service Questions

Q33:-What is the transport protocol you use to call a Web service?
ANS:-SOAP (Simple Object Access Protocol) is the preferred protocol.

Q34:-True or False: A Web service can only be written in .NET?
ANS:-False

Q35:-What does WSDL stand for?
ANS:-Web Services Description Language.

Q36:-Where on the Internet would you look for Web services?
ANS:-http://www.uddi.org

Q37:-True or False: To test a Web service you must create a Windows application or Web application to consume this service?
ANS:-False, the web service comes with a test page and it provides HTTP-GET method to test.

State Management Questions

Q39:-What is ViewState?
ANS:-ViewState allows the state of objects (serializable) to be stored in a hidden field on the page. ViewState is transported to the client and back to the server, and is not stored on the server or any other external source. ViewState is used the retain the state of server-side objects between postabacks.

Q40:-What is the lifespan for items stored in ViewState?
ANS:-Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page).

Q41:-What does the "EnableViewState" property do? Why would I want it on or off?
ANS:-It allows the page to save the users input on a form across postbacks. It saves the server-side values for a given control into ViewState, which is stored as a hidden value on the page before sending the page to the clients browser. When the page is posted back to the server the server control is recreated with the state stored in viewstate.

Q42:-What are the different types of Session state management options available with ASP.NET?
ANS:-ASP.NET provides In-Process and Out-of-Process state management. In-Process stores the session in memory on the web server. This requires the a "sticky-server" (or no load-balancing) so that the user is always reconnected to the same web server. Out-of-Process Session state management stores data in an external data source. The external data source may be either a SQL Server or a State Server service. Out-of-Process state management requires that all objects stored in session are serializable.

Q43:-What do I need to create and run an ASP.NET application?
ANS:-Windows 2000, Windows Server 2003 or Windows XP.
ASP.NET, which can be either the redistributable (included in the .NET SDK) or Visual Studio .NET.


Q44:-Where can I download the .NET SDK?
ANS:-.NET SDK can be obtained here.

(You have to install the Microsoft .NET Framework Version 1.1 Redistributable Package before installing the .NET SDK.)

Q45:-Are there any free IDEs for the .NET SDK?
ANS:-Microsoft provides Visual Studio 2005 Express Edition Beta for free. Of particular interest to the ASP.NET developers would be the Visual Web Developer 2005 Express Edition Beta 2 available as a free download.
The ASP.NET Web Matrix Project (supported by Microsoft) is a free IDE for developing ASP.NET applications and is available here.
There is also a free open-source UNIX version of the Microsoft .NET development platform called Mono available for download here.
Another increasingly popular Open Source Development Environment for .NET is the #develop (short for SharpDevelop) available for download here.

Q46:-When was ASP.NET released?
ANS:-ASP.NET is a part of the .NET framework which was released as a software platform in 2002.

Q47:-Is a new version coming up?
ANS:-ASP.NET 2.0, Visual Studio 2005 (Whidbey), Visual Web Developer 2005 Express Edition are the next releases of Microsoft's Web platform and tools. They have already been released as Beta versions. They are scheduled to be released in the week of November 7, 2005.

Q48:-Explain Namespace.
ANS:-Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace.

Q49:-List the types of Authentication supported by ASP.NET.
ANS:-
Windows (default)
Forms
Passport
None (Security disabled)

Q50:-What is CLR?
ANS:-Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).

Q51:-What is CLI?
ANS:-The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL). (Source: Wikipedia.)

Q52:-List the various stages of Page-Load lifecycle.
ANS:-
Init()
Load()
PreRender()
Unload()

Q53:-Explain Assembly and Manifest.
ANS:-An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System. Reflection namespace. The tool Intermediate Language Dissembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.

Q54:-What is Shadow Copy?
ANS:-In order to replace a COM component on a live web server, it was necessary to stop the entire website, copy the new files and then restart the website. This is not feasible for the web servers that need to be always running. .NET components are different. They can be overwritten at any time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are automatically detected by the CLR and the changed components will be automatically loaded. They will be used to process all new requests not currently executing, while the older version still runs the currently executing requests. By bleeding out the older version, the update is completed.

Q55:-What is DLL Hell?
ANS:-DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.

Q56:-Explain Web Services.
ANS:-Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.

Q57:-Explain Windows Forms.
ANS:-Windows Forms is employed for developing Windows GUI applications. It is a class library that gives developers access to Windows Common Controls with rich functionality. It is a common GUI library for all the languages supported by the .NET Framework.

Q58:-What is Postback?
ANS:-When an action occurs (like button click), the page containing all the controls within the tag performs an HTTP POST, while having itself as the target URL. This is called Postback.

Q59:-Explain the differences between server-side and client-side code?
ANS:-Server side scripting means that all the script will be executed by the server and interpreted as needed. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source. It also poses as a possible security hazard for the client computer.
Q60:-Enumerate the types of Directives.
ANS:-
@ Page directive
@ Import directive
@ Implements directive
@ Register directive
@ Assembly directive
@ OutputCache directive
@ Reference directive

Q61:-What is Code-Behind?
ANS:-Code-Behind is a concept where the contents of a page are in one file and the server-side code is in another. This allows different people to work on the same page at the same time and also allows either part of the page to be easily redesigned, with no changes required in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page.

Q62:-Describe the difference between inline and code behind.
ANS:-Inline code is written along side the HTML in a page. There is no separate distinction between design code and logic code. Code-behind is code written in a separate file and referenced by the .aspx page.

Q63:-List the ASP.NET validation controls?
ANS:-
RequiredFieldValidator
RangeValidator
CompareValidator
RegularExpressionValidator
CustomValidator
ValidationSummary

Q64:-What is Data Binding?
ANS:-Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.

Q65:-Describe Paging in ASP.NET.
ANS:-The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode.

Q66:-Should user input data validation occur server-side or client-side? Why?
ANS:-All user input data validation should occur on the server and minimally on the client-side, though it is a good way to reduce server load and network traffic because we can ensure that only data of the appropriate type is submitted from the form. It is totally insecure. The user can view the code used for validation and create a workaround for it. Secondly, the URL of the page that handles the data is freely visible in the original form page. This will allow unscrupulous users to send data from their own forms to your application. Client-side validation can sometimes be performed where deemed appropriate and feasible to provide a richer, more responsive experience for the user.


Q67:-What is the difference between Server.Transfer and Response.Redirect?
ANS:-Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser.
Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well.

Q68:-What is an interface and what is an abstract class?
ANS:-In an interface, all methods must be abstract (must not be defined). In an abstract class, some methods can be defined. In an interface, no accessibility modifiers are allowed, whereas it is allowed in abstract classes.

Q69:-Session state vs. View state:
ANS:-In some cases, using view state is not feasible. The alternative for view state is session state. Session state is employed under the following situations:

Large amounts of data - View state tends to increase the size of both the HTML page sent to the browser and the size of form posted back. Hence session state is used.
Secure data - Though the view state data is encoded and may be encrypted, it is better and secure if no sensitive data is sent to the client. Thus, session state is a more secure option.
Problems in serializing of objects into view state - View state is efficient for a small set of data. Other types like DataSet are slower and can generate a very large view state.
Can two different programming languages be mixed in a single ASPX file?
ASP.NET’s built-in parsers are used to remove code from ASPX files and create temporary files. Each parser understands only one language. Therefore mixing of languages in a single ASPX file is not possible.

Q70:-Is it possible to see the code that ASP.NET generates from an ASPX file?
ANS:-By enabling debugging using a <%@ Page Debug="true" %> directive in the ASPX file or a statement in Web.config, the generated code can be viewed. The code is stored in a CS or VB file (usually in the \%SystemRoot%\Microsoft.NET\Framework\v1.0.nnnn\Temporary ASP.NET Files).

Q71:-Can a custom .NET data type be used in a Web form?
ANS:-This can be achieved by placing the DLL containing the custom data type in the application root's bin directory and ASP.NET will automatically load the DLL when the type is referenced.

Q72:-List the event handlers that can be included in Global.asax?
ANS:-Application start and end event handlers
Session start and end event handlers
Per-request event handlers
Non-deterministic event handlers

Q73:-Can the view state be protected from tampering?
ANS:-This can be achieved by including an @ Page directive with an EnableViewStateMac="true" attribute in each ASPX file that has to be protected. Another way is to include the statement in the Web.config file.


Q74:-Can the view state be encrypted?
ANS:-The view state can be encrypted by setting EnableViewStateMac to true and either modifying the element in Machine.config to or by adding the above statement to Web.config.

Q75:-When during the page processing cycle is ViewState available?
ANS:-The view state is available after the Init() and before the Render() methods are called during Page load.

Q76:-Do Web controls support Cascading Style Sheets?
All Web controls inherit a property named CssClass from the base class System.Web.UI.WebControls.WebControl which can be used to control the properties of the web control.

Q77:-What namespaces are imported by default in ASPX files?
ANS:-The following namespaces are imported by default. Other namespaces must be imported manually using @ Import directives.

System
System.Collections
System.Collections.Specialized
System.Configuration
System.Text
System.Text.RegularExpressions
System.Web
System.Web.Caching
System.Web.Security
System.Web.SessionState
System.Web.UI
System.Web.UI.HtmlControls
System.Web.UI.WebControls

Q78:-What classes are needed to send e-mail from an ASP.NET application?
ANS:-The classes MailMessage and SmtpMail have to be used to send email from an ASP.NET application. MailMessage and SmtpMail are classes defined in the .NET Framework Class Library's System.Web.Mail namespace.

Q79:-Why do some web service classes derive from System.Web.WebServices while others do not?
ANS:-Those Web Service classes which employ objects like Application, Session, Context, Server, and User have to derive from System.Web.WebServices. If it does not use these objects, it is not necessary to be derived from it.

Q80:-What are VSDISCO files?
ANS:-VSDISCO files are DISCO files that enable dynamic discovery of Web Services. ASP.NET links the VSDISCO to a HTTP handler that scans the host directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document. A client who requests a VSDISCO file gets back what appears to be a static DISCO document.



Q81:-How can files be uploaded to Web pages in ASP.NET?
This can be done by using the HtmlInputFile class to declare an instance of an tag. Then, a byte[] can be declared to read in the data from the input file. This can then be sent to the server.

Q82:-How do I create an ASPX page that periodically refreshes itself?
ANS:-The following META tag can be used as a trigger to automatically refresh the page every n seconds:


Q83:-How do I initialize a TextBox whose TextMode is "password", with a password?
ANS:-The TextBox’s Text property cannot be used to assign a value to a password field. Instead, its Value field can be used for that purpose.


Q84:-Why does the control's PostedFile property always show null when using HtmlInputFile control to upload files to a Web server?
ANS:-This occurs when an enctype="multipart/form-data" attribute is missing in the form tag.

Q85:-How can the focus be set to a specific control when a Web form loads?
ANS:-This can be achieved by using client-side script:

document.forms[0].TextBox1.focus ()
The above code will set the focus to a TextBox named TextBox1 when the page loads.

Q86:-How does System.Web.UI.Page's IsPostBack property work?
ANS:-IsPostBack checks to see whether the HTTP request is accompanied by postback data containing a __VIEWSTATE or __EVENTTARGET parameter. If there are none, then it is not a postback.

Q87:-What is WSDL?
ANS:-WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). (Source: www.w3.org)

Q88:-What is UDDI?
ANS:-UDDI stands for Universal Description, Discovery, and Integration. It is like an "Yellow Pages" for Web Services. It is maintained by Microsoft, IBM, and Ariba, and is designed to provide detailed information regarding registered Web Services for all vendors. The UDDI can be queried for specific Web Services.

Q89:-Is it possible to generate the source code for an ASP.NET Web service from a WSDL?
ANS:-The Wsdl.exe tool (.NET Framework SDK) can be used to generate source code for an ASP.NET web service with its WSDL link.

Example: wsdl /server http://api.google.com/GoogleSearch.wsdl.

Q91:-Why do uploads fail while using an ASP.NET file upload control to upload large files?
ANS:-ASP.NET limits the size of file uploads for security purposes. The default size is 4 MB. This can be changed by modifying the maxRequestLength attribute of Machine.config's element.

Q102:-Differences Between XML and HTML?
ANS:-Anyone with a fundamental grasp of XML should be able describe some of the main differences outlined in the table below
XML HTML
User definable tags Defined set of tags designed for web display
Content driven Format driven
End tags required for well formed documents End tags not required
Quotes required around attributes values Quotes not required
Slash required in empty tags Slash not required

Q103:-Give a few examples of types of applications that can benefit from using XML.
ANS:-There are literally thousands of applications that can benefit from XML technologies. The point of this question is not to have the candidate rattle off a laundry list of projects that they have worked on, but, rather, to allow the candidate to explain the rationale for choosing XML by citing a few real world examples. For instance, one appropriate answer is that XML allows content management systems to store documents independently of their format, which thereby reduces data redundancy. Another answer relates to B2B exchanges or supply chain management systems. In these instances, XML provides a mechanism for multiple companies to exchange data according to an agreed upon set of rules. A third common response involves wireless applications that require WML to render data on hand held devices.

Q104:-What is DOM and how does it relate to XML?
ANS:-The Document Object Model (DOM) is an interface specification maintained by the W3C DOM Workgroup that defines an application independent mechanism to access, parse, or update XML data. In simple terms it is a hierarchical model that allows developers to manipulate XML documents easily Any developer that has worked extensively with XML should be able to discuss the concept and use of DOM objects freely. Additionally, it is not unreasonable to expect advanced candidates to thoroughly understand its internal workings and be able to explain how DOM differs from an event-based interface like SAX.

Q105:-What is SOAP and how does it relate to XML?
ANS:-The Simple Object Access Protocol (SOAP) uses XML to define a protocol for the exchange of information in distributed computing environments. SOAP consists of three components: an envelope, a set of encoding rules, and a convention for representing remote procedure calls. Unless experience with SOAP is a direct requirement for the open position, knowing the specifics of the protocol, or how it can be used in conjunction with HTTP, is not as important as identifying it as a natural application of XML.

Q106:-Can you walk us through the steps necessary to parse XML documents?
ANS:-Superficially, this is a fairly basic question. However, the point is not to determine whether candidates understand the concept of a parser but rather have them walk through the process of parsing XML documents step-by-step. Determining whether a non-validating or validating parser is needed, choosing the appropriate parser, and handling errors are all important aspects to this process that should be included in the candidate's response.

Q107:-What are possible implementations of distributed applications in .NET?
ANS:-.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy classes are in System.Runtime.Remoting and System.Web.Services.

Q108:-What are the consideration in deciding to use .NET Remoting or ASP.NET Web Services?
Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.

Q109:-What’s a proxy of the server object in .NET Remoting?
ANS:-It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.

Q110:-What are remotable objects in .NET Remoting?
ANS:-Remotable objects are the objects that can be marshaled across the application domains. You can marshal by value, where a deep copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

Q111:-What are channels in .NET Remoting?
ANS:-Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.

Q112:-What security measures exist for .NET Remoting in System.Runtime.Remoting?
ANS:-None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.

Q113:-What is a formatter?
ANS:-A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

Q114:-Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs?
ANS:-Binary over TCP is the most effiecient, SOAP over HTTP is the most interoperable.

Q115:-What’s SingleCall activation mode used for?
ANS:-If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.

Q116:-What’s Singleton activation mode?
ANS:-A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.

Q117:-How do you define the lease of the object?
ANS:-By implementing ILease interface when writing the class code.


Q118:-Can you configure a .NET Remoting object via XML file?
ANS:-Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config.

Q119:-How can you automatically generate interface for the remotable object in .NET with Microsoft tools?
ANS:-Use the Soapsuds tool.

Q120:-What are the new Data Controls in Asp.net 2.0?
ANS:-Data access in ASP.NET 2.0 can be accomplished completely declaratively (no code) using the new data-bound and data source controls. There are new data source controls to represent different data backends such as SQL database, business objects, and XML, and there are new data-bound controls for rendering common UI for data, such as gridview, detailsview, and formview.

Q121:-What are the new Navigation Controls in Asp.net 2.0?
ANS:-The navigation controls provide common UI for navigating between pages in your site, such as treeview, menu, and sitemappath. These controls use the site navigation service in ASP.NET 2.0 to retrieve the custom structure you have defined for your site.

Q122:-What are the new Login Controls in Asp.net 2.0?
ANS:-The new login controls provide the building blocks to add authentication and authorization-based UI to your site, such as login forms, create user forms, password retrieval, and custom UI for logged in users or roles. These controls use the built-in membership and role services in ASP.NET 2.0 to interact with the user and role information defined for your site.

Q123:-What are the new Web Part Controls in Asp.net 2.0 ?
ANS:-Web parts are an exciting new family of controls that enable you to add rich, personalized content and layout to your site, as well as the ability to edit that content and layout directly from your application pages. These controls rely on the personalization services in ASP.NET 2.0 to provide a unique experience for each user in your application.

Q124:-What are Master Pages?
ANS:-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.

Q125:-What are Themes and Skins in 2.0, explain usgae scenario?
ANS:-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.

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

Q127:-What is Configuration API?
ANS:-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.

Q128:-What is MMC Admin Tool?
ANS:-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.

Q129:-Explain the use of Pre-compilation Tool?
ANS:-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.

Q130:-How is application management and maintenance improved in Asp.net 2.0?
ANS:-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.

Q131:-What are Provider-driven Application Services? explain in detail?
ANS:-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.

Q132:-Explain Server Control Extensibility with reference to Asp.net 2.0 ?
ANS:-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.

Q133:-What are the Data Source Controls?
ANS:-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.

Q134:-What are Compilation Build Providers?
ANS:-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.

Q135:-What is Expression Builders, why would you use it?
ANS:-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.

Q136:-Is ASP.NET 64-Bit enabled? How?
ANS:-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).

Q136:-Explain how Caching in Asp.net 2.0 is different from Caching in Asp.net 1.1?
ANS:-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.

Q137:- 1.Difference between Classic ASP and ASP.Net?
Answer: ASP is Interpreted language based on scripting languages like Jscript or VBScript.
 ASP has Mixed HTML and coding logic.
 Limited development and debugging tools available.
 Limited OOPS support.
 Limited session and application state management.
 Poor Error handling system.
 No in-built support for XML.
 No fully distributed data source support.
while
 ASP.Net is supported by compiler and has compiled language support.
 Separate code and design logic possible.
 Variety of compilers and tools available including the Visual studio.Net.
 Completely Object Oriented.
 Complete session and application state management.
 Full proof error handling possible.
 Full XML Support for easy data exchange.
 Fully distributed data source support.



Q138:- 3.Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Answer:
 A DataSet can represent an entire relational database in memory, complete with tables, relations, and views, A Recordset can not.
 A DataSet is designed to work without any continues connection to the original data source; Recordset maintains continues connection with the original data source.
 There's no concept of cursor types in a DataSet, They are bulk loaded, while Recordset work with cursors and they are loaded on demand.
 DataSets have no current record pointer, you can use For Each loops to move through the data. Recordsets have pointers to move through them.
 You can store many edits in a DataSet, and write them to the original data source in a single operation. Recordset can have a single edit at a time.
 Dataset can fetch source data from many tables at a time, for Recordset you can achieve the same only using the SQL joins.

Q139:-What is the difference between an abstract method & virtual method?
Answer: An Abstract method does not provide an implementation and forces overriding to the deriving class (unless the deriving class also an abstract class), where as the virtual method has an implementation and leaves an option to override it in the deriving class. Thus Virtual method has an implementation & provides the derived class with the option of overriding it. Abstract method does not provide an implementation & forces the derived class to override the method.

Q140:-What is the difference between static or dynamic assemblies?
Answer: 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. You can also use the .NET Framework to create 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.

Q141:-What are the difference between Structure and Class?
Answer:
 Structures are value type and Classes are reference type.
 Structures can not have contractors or destructors. Classes can have both contractors and destructors.
 Structures do not support Inheritance, while Classes support Inheritance.

Q142:-What are the difference between const and readonly?
Answer:
 A const can not be static, while readonly can be static.
 A const need to be declared and initialized at declaration only, while a readonly can be initialized at declaration or by the code in the constructor.
 A const’s value is evaluated at design time, while a readonly’s value is evaluated at runtime.

Q143:-Differences between dataset.clone and dataset.copy
Answer: dataset.clone copies just the structure of dataset (including all the datatables, schemas, relations and constraints.); however it doesn’t copy the data. On the other hand dataset.copy, copies both the dataset structure and the data.

Q144:-Describe the difference between inline and code behind.
Answer: Inline code written along with the html and design blocks in an .aspx page. Code-behind is code written in a separate file (.cs or .vb) and referenced by the .aspx page.

Q145:-What is Difference between Namespace and Assembly?
Answer: Namespace is a logical design-time naming convenience, whereas an assembly Physically grouping of logical units.

Q146:-What is the difference between early binding and late binding?
Answer: 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.

Q147:-What is the difference between Custom Control and User Control?
Answer: 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.

Q148:-What is the difference between ASP Session State and ASP.Net Session State?
Answer: 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.

Q149:-Difference between ASP Session and ASP.NET Session?
Answer: Asp.net session supports cookie less session & it can span across multiple servers.

Q150:-Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines?
Answer: All the global declarations or the variables used commonly across the application can be deployed under Application_Start. All the user specific tasks or declarations can be dealt in the Session_Start subroutine.

Q151:-What is the lifespan for items stored in ViewState?
Answer: Items stored in a ViewState exist for the life of the current page, including the post backs on the same page.

Q152:-What are the advantages of an assembly?
Answer: Increased performance. Better code management and encapsulation. It also introduces the n-tier concepts and business logic.

Q153:-What is the purpose of an Assembly?
Answer: An assembly controls many aspects of an application. The assembly handles versioning, type and class scope, security permissions, as well as other metadata including references to other assemblies and resources. The rules described in an assembly are enforced at runtime.

Q154:-What a static assembly consist of in general?
Answer:
 In general, a static assembly consist of the following four elements:
 Assembly Manifest, which contains the assembly metadata.
 Type Metadata.
 MSIL code that implements the types.
 A set of resources.
From above all only the manifest is required, however the other types and resources add the additional functionality to the assembly.

Q155:-What is GAC or Global Assembly Cache?
Answer: Global Assembly Cache (GAC) is a common place to share the .NET assemblies across many applications. GAC caches all strong named assembly references within it. All System assemblies that come with the .NET framework reside in the GAC.

Q156:-How to view an assembly?
Answer: We can use the tool "ildasm.exe" known as "Assembly Disassembler" to view the assembly.

Q157:-What is Authentication and Authorization?
Answer: 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.

Q158:-What are the types of Authentication? Describe.
Answer: There are 3 types of Authentication. Windows, Forms and Passport Authentication.
 Windows authentication uses the security features integrated into the Windows NT and Windows XP operating systems to authenticate and authorize Web application users.
 Forms authentication allows you to create your own list/database of users and validate the identity of those users when they visit your Web site.
 Passport authentication uses the Microsoft centralized authentication provider to identify users. Passport provides a way to for users to use a single identity across multiple Web applications. To use Passport authentication in your Web application, you must install the Passport SDK.

Q159:-What are the types of comment in C#?
Answer: There are 3 types of comments in C#.
Single line (//), Multi line (/* */) and Page/XML Comments (///).

Q160:-What is an ArrayList?
Answer: The ArrayList object is a collection of items containing a single data type values.

Q161:-What is a HashTable?
Answer: The Hashtable object contains items in key/value pairs. The keys are used as indexes, and very quick searches can be made for values by searching through their keys.

Q162:-What is SortedList?
Answer: The SortedList object contains items in key/value pairs. A SortedList object automatically sorts items in alphabetic or numeric order.

Q163:-What is a Literal Control?
Answer: The Literal control is used to display text on a page. The text is programmable. This control does not let you apply styles to its content!




Q164:-What is CAS or Code Access Security?
Answer: CAS is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting a hard disk.

Q165:-What is Side-by-Side Execution?
Answer: The CLR allows any versions of the same-shared DLL (shared assembly) to execute at the same time, on the same system, and even in the same process. This concept is known as side-by-side execution.

Q166:-What are the different types of Caching?
Answer: There are three types of Caching:
 Output Caching: stores the responses from an asp.net page.
 Fragment Caching: Only caches/stores the portion of page (User Control)
 Data Caching: is Programmatic way to Cache objects for performance.

Q167:-How to Manage State in ASP.Net?
Answer: There are several ways to manage a state.
 ViewState
 QueryString
 Cookies
 Session
 Application

Q168:-What method do you use to explicitly kill a user’s Session?
Answer: HttpContext.Current.Session.Abandon().

Q169:-What are the layouts of ASP.NET Pages?
Answer: GridLayout and FlowLayout. GridLayout positions the form object on absolute x and y co-ordinates of the screen. FlowLayout positions the form objects relative to each other.

Q170:-What is the Web User Control?
Answer: Combines existing Server and/or HTML controls by using VS.Net to create functional units that encapsulate some aspects of UI. Resides in Content Files, which must be included in project in which the controls are used.

Q171:-What is the Composite Custom Control?
Answer: combination of existing HTML and Server Controls.

Q172:-What are the satellite assemblies?
Answer: in a multilingual or multi-cultural application, the localized assemblies, which contain language specific instructions that modify the core application, are kept separately and they are called satellite assemblies.

Q173:-What namespaces are necessary to create a localized application?
Answer: System.Globalization, System.Resources

0 Response to ".Net Interview Questions With Answers"

Post a Comment

    Featured-video

    Tag-cloud