.Net Questions by skms

VIEWS: 1,079 PAGES: 40

									ASP.NET 1. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process. inetinfo.exe is theMicrosoft 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 tothe actual worker process aspnet_wp.exe. What’s the difference between Response.Write() andResponse.Output.Write()? Response.Output.Write() allows you to write formatted output. What methods are fired during the page load? 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. When during the page processing cycle is ViewState available? After the Init() and before the Page_Load(), or OnLoad() for a control. What namespace does the Web page belong in the .NET Framework class hierarchy? System.Web.UI.Page Where do you store the information about the user’s locale? System.Web.UI.Page.Culture What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"? CodeBehind is relevant to Visual Studio.NET only. What’s a bubbled event? 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. Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler? Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");

2.

3.

4.

5.

6.

7.

8.

9.

10. What data types do the RangeValidator control support? Integer, String, and Date. 11. Explain the differences between Server-side and Client-side code? Server-side code executes on the server. Client-side code executes in the client's browser. 12. What type of code (server or client) is found in a Code-Behind class? 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. 13. Should user input data validation occur server-side or client-side? Why? All 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.

14. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? 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. 15. Can you explain the difference between an ADO.NET Dataset and an ADO Recordset? Valid answers are: · 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. 16. What is the Global.asax used for? The Global.asax (including the Global.asax.cs file) is used to implement application and session level events. 17. What are the Application_Start and Session_Start subroutines used for? This is where you can set the specific variables for the Application and Session objects. 18. Can you explain what inheritance is and an example of when you might use it? 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. 19. Whats an assembly? Assemblies are the building blocks of the .NET framework. Overview of assemblies from MSDN 20. Describe the difference between inline and code behind. 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. 21. Explain what a diffgram is, and a good use for one? 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. 22. Whats MSIL, and why should my developers need an appreciation of it if at all? 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. 23. Which method do you invoke on the DataAdapter control to load your generated dataset with data? The Fill() method. 24. Can you edit data in the Repeater control? No, it just reads the information from its data source.

25. Which template must you provide, in order to display data in a Repeater control? ItemTemplate. 26. How can you provide an alternating color scheme in a Repeater control? Use the AlternatingItemTemplate. 27. 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? You must set the DataSource property and call the DataBind method. 28. What base class do all Web Forms inherit from? The Page class. 29. Name two properties common in every validation control? ControlToValidate property and Text property. 30. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box? DataTextField property. 31. Which control would you use if you needed to make sure the values in two different controls matched? CompareValidator control. 32. How many classes can a single .NET DLL contain? It can contain many classes.

Web Service Questions 1. What is the transport protocol you use to call a Web service? SOAP (Simple Object Access Protocol) is the preferred protocol. True or False: A Web service can only be written in .NET? False What does WSDL stand for? Web Services Description Language. Where on the Internet would you look for Web services? http://www.uddi.org True or False: To test a Web service you must create a Windows application or Web application to consume this service? False, the web service comes with a test page and it provides HTTP-GET method to test.

2.

3.

4.

5.

State Management Questions 1. What is ViewState? 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.

2.

What is the lifespan for items stored in ViewState? Item stored in ViewState exist for the life of the current page. This includes postbacks (to the same page). What does the "EnableViewState" property do? Why would I want it on or off? 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. What are the different types of Session state management options available with ASP.NET? 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. What are the main differences between asp and asp.net? ASP 3.0 • Supports VBScript and JavaScript o scripting languages are limited in scope o interpreted from top to bottom each time the page is loaded • Files end with *.asp extension • 5 objects: Request, Response, Server, Application, Session • Queried databases return recordsets • Uses conventional HTML forms for data collection ASP .NET • Supports a number of languages including Visual Basic, C#, and JScript o code is compiled into .NET classes and stored to speed up multiple hits on a page o object oriented and event driven makes coding web pages more like traditional applications • Files end with *.aspx extension • .NET contains over 3400 classes • XML-friendly data sets are used instead of recordsets • Uses web forms that look like HTML forms to the client, but add much functionality due to server-side coding • Has built-in validation objects • Improved debugging feature (great news for programmers) • ASP .NET controls can be binded to a data source, including XML recordsets Source: mikekissman.com 2. What is a user control? • An ASP.NET user control is a group of one or more server controls or static HTML elements that encapsulate a piece of functionality. A user control could simply be an extension of the functionality of an existing server control(s) (such as an image control that can be rotated or a calendar control that stores the date in a text box). Or, it could consist of several elements that work and interact together to get a job done (such as several controls grouped together that gather information about a user's previous work experience). Source: 15seconds.com

3.

4.

1.

3. What are different types of controls available in ASP.net? • HTML server controls HTML elements exposed to the server so you can program them. HTML server controls expose an object model that maps very closely to the HTML elements that they render. • Web server controls Controls with more built-in features than HTML server controls. Web server controls include not only form-type controls such as buttons and text boxes, but also special-purpose controls such as a calendar. Web server controls are more abstract than HTML server controls in that their object model does not necessarily reflect HTML syntax. • Validation controls Controls that incorporate logic to allow you to test a user's input. You attach a validation control to an input control to test what the user enters for that input control. Validation controls are provided to allow you to check for a required field, to test against a specific value or pattern of characters, to verify that a value lies within a range, and so on. • User controls Controls that you create as Web Forms pages. You can embed Web Forms user controls in other Web Forms pages, which is an easy way to create menus, toolbars, and other reusable elements. • Note You can also create output for mobile devices. To do so, you use the same ASP.NET page framework, but you create Mobile Web Forms instead of Web Forms pages and use controls specifically designed for mobile devices. Source: MSDN 4. What are the validation controls available in ASP.net? Type of validation Control to use Description Required entry RequiredFieldValidator Ensures that the user does not skip an entry. Comparison to a value CompareValidator Compares a user's entry against a constant value, or against a property value of another control, using a comparison operator (less than, equal, greater than, and so on). Range checking RangeValidator Checks that a user's entry is between specified lower and upper boundaries. You can check ranges within pairs of numbers, alphabetic characters, and dates. Pattern matching RegularExpressionValidator Checks that the entry matches a pattern defined by a regular expression. This type of validation allows you to check for predictable sequences of characters, such as those in social security numbers, e-mail addresses, telephone numbers, postal codes, and so on. User-defined CustomValidator Checks the user's entry using validation logic that you write yourself. This type of validation allows you to check for values derived at run time. Source: MSDN 5. How will you upload a file to IIS in Asp and how will you do the same in ASP.net? First of all, we need a HTML server control to allow the user to select the file. This is nothing but the same old <input tag, with the type set to File, such as <input type=file id=‖myFile‖ runat=server />. This will give you the textbox and a browse button. Once you have this, the user can select any file from their computer (or even from a network). Then, in the Server side, we need the following line to save the file to the Web Server. myFile.PostedFile.SaveAs ("DestinationPath") Note: The Form should have the following ENC Type <form enctype="multipart/form-data" runat="server"> Source: ASP Alliance 6. What is Attribute Programming? What are attributes? Where are they used? Attributes are a mechanism for adding metadata, such as compiler instructions and other data about your data, methods, and classes, to the program itself. Attributes are inserted into the metadata and are visible through ILDasm and other metadata-reading tools. Attributes can be used to identify or use the data at runtime execution using .NET Reflection. Source: OnDotNet.com

7. What is the difference between Data Reader & Dataset? Data Reader is connected, read only forward only record set. Dataset is in memory database that can store multiple tables, relations and constraints; moreover dataset is disconnected and is not aware of the data source. 8. What is the difference between server side and client side code? Server code is executed on the web server where as the client code is executed on the browser machine. 9. Why would you use “EnableViewState” property? What are the disadvantages? EnableViewState allows me to retain the values of the controls properties across the requests in the same session. It hampers the performance of the application. 10. What is the difference between Server. Transfer and Response. Redirect? The Transfer method allows you to transfer from inside one ASP page to another ASP page. All of the state information that has been created for the first (calling) ASP page will be transferred to the second (called) ASP page. This transferred information includes all objects and variables that have been given a value in an Application or Session scope, and all items in the Request collections. For example, the second ASP page will have the same SessionID as the first ASP page. When the second (called) ASP page completes its tasks, you do not return to the first (calling) ASP page. All these happen on the server side browser is not aware of this. The redirect message issue HTTP 304 to the browser and causes browser to got the specified page. Hence there is round trip between client and server. Unlike transfer, redirect doesn‘t pass context information to the called page. 11. What is the difference between Application_start and Session_start? Application_start gets fired when an application receive the very first request. Session_start gets fired for each of the user session. 12. What is inheritance and when would you use inheritance? The concept of child class inheriting the behavior of the parent is called inheritance. If there are many classes in an application that have some part of their behavior common among all , inheritance would be used. 13. What is the order of events in a web form? 1. Init 2. Load 3. Cached post back events 4. Prerender 5. Unload 14. Can you edit Data in repeater control? No 15. Which template you must provide to display data in a repeater control? Item Template

16. How can you provide an alternating color scheme in a Data Grid? Use ALTERNATINGITEMSTYLE and ITEMSTYLE, attributes or Templates 17. Is it possible to bind a data to Textbox? Yes 18. What method I should call to bind data to control? Bind Data () 19. How can I kill a user session? Call session. abandon. 21. Which is the common property among all the validation controls? ControlToValidate 22. How do you bind a data grid column manually? Use BoundColumn tag. 23. Web services can only be written in .NET, true or false? False 24. What does WSDL, UDDI stands for? Web Service Description Language. Universal Description Discovery and Integration 25. How can you make a property read only? (C#) Use key word Read Only 25. Which validation control is used to match values in two controls? Compare Validation control. 26. To test a Web Service I must create either web application or windows application. True or false? False 27. How many classes can a single .NET assembly contains? Any number 28. What are the data types available in JavaScript? Object is the only data type available. 29. Is it possible to share session information among ASP and ASPX page? No, it is not possible as both of these are running under different processes. 30. What are the caching techniques available? Page cahahing. Fragment Caching And Data Caching 31. What are the different types of authentication modes available? 1. Window. 2. Form. 3. Passport. 4. None.

32. Explain the steps involved to populate dataset with data? Open connection Initialize Adapter passing SQL and connection as parameter Initialize Dataset Call Fill method of the adapter passes dataset as the parameter Close connection. 33. Can I have data from two different sources into a single dataset? Yes, it is possible. 34. Is it possible load XML into a Data Reader? No. 35. Is it possible to have tables in the dataset that are not bound to any data source? Yes, we can create table object in code and add it to the dataset. 36. Why do you deploy an assembly into GAC? To allow other application to access the shared assembly. 37. How do you uninstall assembly from GAC? Use Gacutil.exe with U switch. 38. What does Regasm do? The Assembly Registration tool reads the metadata within an assembly and adds the necessary entries to the registry, which allows COM clients to create .NET Framework classes transparently. Once a class is registered, any COM client can use it as though the class were a COM class. The class is registered only once, when the assembly is installed. Instances of classes within the assembly cannot be created from COM until they are actually registered. 39. What is the difference between Execute Scalar and ExceuteNoneQuery? Execute Scalar returns the value in the first row first column of a query result set. ExceuteNonQuery return number of rows affected. 40. What is an assembly? Assembly is a deployment unit of .NET application. In practical terms assembly is an Executable or a class library. 41. What is CLR? The common language runtime is the execution engine for .NET Framework applications. It provides a number of services, including the following: • Code management (loading and execution) Application memory isolation • Verification of type safety • Conversion of IL to native code • Access to metadata (enhanced type information) • Managing memory for managed objects • Enforcement of code access security • Exception handling, including cross-language exceptions • Interoperation between managed code, COM objects, and pre-existing DLLs (unmanaged code and data) • Automation of object layout • Support for developer services (profiling, debugging, and so on) 42. What is the common type system (CTS)? The common type system is a rich type system, built into the common language runtime that supports the types and operations found in most programming languages. The common type system supports the complete implementation of a wide range of programming languages.

43. What is the Common Language Specification (CLS)? The Common Language Specification is a set of constructs and constraints that serves as a guide for library writers and compiler writers. It allows libraries to be fully usable from any language supporting the CLS, and for those languages to integrate with each other. The Common Language Specification is a subset of the common type system. The Common Language Specification is also important to application developers who are writing code that will be used by other developers. When developers design publicly accessible APIs following the rules of the CLS, those APIs are easily used from all other programming languages that target the common language runtime. 44. What is the Microsoft Intermediate Language (MSIL)? MSIL is the CPU-independent instruction set into which .NET Framework programs are compiled. It contains instructions for loading, storing, initializing, and calling methods on objects. Combined with metadata and the common type system, MSIL allows for true cross-language integration. Prior to execution, MSIL is converted to machine code. It is not interpreted. 45. What is managed code and managed data? Managed code is code that is written to target the services of the common language runtime (see what is the Common Language Runtime?). In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic .NET, and JScript .NET code is managed by default. Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR). Closely related to managed code is managed data—data that is allocated and de-allocated by the common language runtime's garbage collector. C#, Visual Basic, and JScript .NET data is managed by default. C# data can, however, be marked as unmanaged through the use of special keywords. Visual Studio .NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed by using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector. In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class). An example of a restriction is that a managed class can only inherit from one base class. 46. What is an assembly? An assembly is the primary building block of a .NET Framework application. It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit or as accessible by code outside that unit. Assemblies are self-describing by means of their manifest, which is an integral part of every assembly. The manifest: Establishes the assembly identity (in the form of a text name), version, culture, and digital signature (if the assembly is to be shared across applications). Defines what files (by name and file hash) make up the assembly implementation. Specifies the types and resources that make up the assembly, including which are exported from the assembly. Itemizes the compile-time dependencies on other assemblies. Specifies the set of permissions required for the assembly to run properly. This information is used at run time to resolve references, enforce version binding policy, and validate the integrity of loaded assemblies. The runtime can determine and locate the assembly for any running

object, since every type is loaded in the context of an assembly. Assemblies are also the unit at which code access security permissions are applied. The identity evidence for each assembly is considered separately when determining what permissions to grant the code it contains. The self-describing nature of assemblies also helps makes zero-impact install and XCOPY deployment feasible. 47. What are private assemblies and shared assemblies? A private assembly is used only by a single application, and is stored in that application's install directory (or a subdirectory therein). A shared assembly is one that can be referenced by more than one application. In order to share an assembly, the assembly must be explicitly built for this purpose by giving it a cryptographically strong name (referred to as a strong name). By contrast, a private assembly name need only be unique within the application that uses it. By making a distinction between private and shared assemblies, we introduce the notion of sharing as an explicit decision. Simply by deploying private assemblies to an application directory, you can guarantee that that application will run only with the bits it was built and deployed with. References to private assemblies will only be resolved locally to the private application directory. There are several reasons you may elect to build and use shared assemblies, such as the ability to express version policy. The fact that shared assemblies have a cryptographically strong name means that only the author of the assembly has the key to produce a new version of that assembly. Thus, if you make a policy statement that says you want to accept a new version of an assembly, you can have some confidence that version updates will be controlled and verified by the author. Otherwise, you don't have to accept them. For locally installed applications, a shared assembly is typically explicitly installed into the global assembly cache (a local cache of assemblies maintained by the .NET Framework). Key to the version management features of the .NET Framework is that downloaded code does not affect the execution of locally installed applications. Downloaded code is put in a special download cache and is not globally available on the machine even if some of the downloaded components are built as shared assemblies. The classes that ship with the .NET Framework are all built as shared assemblies. 48. If I want to build a shared assembly, does that require the overhead of signing and managing key pairs? Building a shared assembly does involve working with cryptographic keys. Only the public key is strictly needed when the assembly is being built. Compilers targeting the .NET Framework provide command line options (or use custom attributes) for supplying the public key when building the assembly. It is common to keep a copy of a common public key in a source database and point build scripts to this key. Before the assembly is shipped, the assembly must be fully signed with the corresponding private key. This is done using an SDK tool called SN.exe (Strong Name). Strong name signing does not involve certificates like Authenticode does. There are no third party organizations involved, no fees to pay, and no certificate chains. In addition, the overhead for verifying a strong name is much less than it is for Authenticode. However, strong names do not make any statements about trusting a particular publisher. Strong names allow you to ensure that the contents of a given assembly haven't been tampered with, and that the assembly loaded on your behalf at run time comes from the same publisher as the one you developed against. But it makes no statement about whether you can trust the identity of that publisher. 49. What is the difference between a namespace and an assembly name? A namespace is a logical naming scheme for types in which a simple type name, such as MyType, is preceded with a dot-separated hierarchical name. Such a naming scheme is completely under the control of the developer. For example, types MyCompany.FileAccess.A and MyCompany.FileAccess.B might be logically expected to have functionality related to file access. The .NET Framework uses a hierarchical naming scheme for grouping types into logical categories of related functionality, such as the Microsoft® ASP.NET application framework, or remoting functionality. Design tools can make use of namespaces to make it easier for developers to browse and

reference types in their code. The concept of a namespace is not related to that of an assembly. A single assembly may contain types whose hierarchical names have different namespace roots, and a logical namespace root may span multiple assemblies. In the .NET Framework, a namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time. 50. What options are available to deploy my .NET applications? The .NET Framework simplifies deployment by making zero-impact install and XCOPY deployment of applications feasible. Because all requests are resolved first to the private application directory, simply copying an application's directory files to disk is all that is needed to run the application. No registration is required. This scenario is particularly compelling for Web applications, Web Services, and self-contained desktop applications. However, there are scenarios where XCOPY is not sufficient as a distribution mechanism. An example is when the application has little private code and relies on the availability of shared assemblies, or when the application is not locally installed (but rather downloaded on demand). For these cases, the .NET Framework provides extensive code download services and integration with the Windows Installer. The code download support provided by the .NET Framework offers several advantages over current platforms, including incremental download, code access security (no more Authenticode dialogs), and application isolation (code downloaded on behalf of one application doesn't affect other applications). The Windows Installer is another powerful deployment mechanism available to .NET applications. All of the features of Windows Installer, including publishing, advertisement, and application repair will be available to .NET applications in Windows Installer 2.0. 51. I've written an assembly that I want to use in more than one application. Where do I deploy it? Assemblies that are to be used by multiple applications (for example, shared assemblies) are deployed to the global assembly cache. In the prerelease and Beta builds, use the /i option to the GACUtil SDK tool to install an assembly into the cache: gacutil /i myDll.dll Windows Installer 2.0, which ships with Windows XP and Visual Studio .NET will be able to install assemblies into the global assembly cache. 52. How can I see what assemblies are installed in the global assembly cache? The .NET Framework ships with a Windows shell extension for viewing the assembly cache. Navigating to % windir%\assembly with the Windows Explorer activates the viewer. 53. What is an application domain? An application domain (often AppDomain) is a virtual process that serves to isolate an application. All objects created within the same application scope (in other words, anywhere along the sequence of object activations beginning with the application entry point) are created within the same application domain. Multiple application domains can exist in a single operating system process, making them a lightweight means of application isolation. An OS process provides isolation by having a distinct memory address space. While this is effective, it is also expensive, and does not scale to the numbers required for large web servers. The Common Language Runtime, on the other hand, enforces application isolation by managing the memory use of code running within the application domain. This ensures that it does not access memory outside the boundaries of the domain. It is important to note that only type-safe code can be managed in this way (the runtime cannot guarantee isolation when unsafe code is loaded in an application domain).

54. What is garbage collection? Garbage collection is a mechanism that allows the computer to detect when an object can no longer be accessed. It then automatically releases the memory used by that object (as well as calling a clean-up routine, called a "finalizer," which is written by the user). Some garbage collectors, like the one used by .NET, compact memory and therefore decrease your program's working set. 55. How does non-deterministic garbage collection affect my code? For most programmers, having a garbage collector (and using garbage collected objects) means that you never have to worry about deallocating memory, or reference counting objects, even if you use sophisticated data structures. It does require some changes in coding style, however, if you typically deallocate system resources (file handles, locks, and so forth) in the same block of code that releases the memory for an object. With a garbage collected object you should provide a method that releases the system resources deterministically (that is, under your program control) and let the garbage collector release the memory when it compacts the working set. 56. Can I avoid using the garbage collected heap? All languages that target the runtime allow you to allocate class objects from the garbage-collected heap. This brings benefits in terms of fast allocation, and avoids the need for programmers to work out when they should explicitly 'free' each object. The CLR also provides what are called ValueTypes—these are like classes, except that ValueType objects are allocated on the runtime stack (rather than the heap), and therefore reclaimed automatically when your code exits the procedure in which they are defined. This is how "structs" in C# operate. Managed Extensions to C++ lets you choose where class objects are allocated. If declared as managed Classes, with the __gc keyword, then they are allocated from the garbage-collected heap. If they don't include the __gc keyword, they behave like regular C++ objects, allocated from the C++ heap, and freed explicitly with the "free" method. 57. How do in-process and cross-process communication work in the Common Language Runtime? There are two aspects to in-process communication: between contexts within a single application domain, or across application domains. Between contexts in the same application domain, proxies are used as an interception mechanism. No marshaling/serialization is involved. When crossing application domains, we do marshaling/serialization using the runtime binary protocol. Cross-process communication uses a pluggable channel and formatter protocol, each suited to a specific purpose. If the developer specifies an endpoint using the tool soapsuds.exe to generate a metadata proxy, HTTP channel with SOAP formatter is the default. If a developer is doing explicit remoting in the managed world, it is necessary to be explicit about what channel and formatter to use. This may be expressed administratively, through configuration files, or with API calls to load specific channels. Options are: HTTP channel w/ SOAP formatter (HTTP works well on the Internet, or anytime traffic must travel through firewalls) TCP channel w/ binary formatter (TCP is a higher performance option for local-area networks (LANs)) When making transitions between managed and unmanaged code, the COM infrastructure (specifically, DCOM) is used for remoting. In interim releases of the CLR, this applies also to serviced components (components that use COM+ services). Upon final release, it should be possible to configure any remotable component. Distributed garbage collection of objects is managed by a system called "leased based lifetime." Each object has a lease time, and when that time expires, the object is disconnected from the remoting infrastructure of the CLR. Objects have a default renew time-the lease is renewed when a successful call is made from the client to the object. The client can also explicitly renew the lease.

58. Can I use COM objects from a .NET Framework program? Yes. Any COM component you have deployed today can be used from managed code, and in common cases the adaptation is totally automatic. Specifically, COM components are accessed from the .NET Framework by use of a runtime callable wrapper (RCW). This wrapper turns the COM interfaces exposed by the COM component into .NET Framework-compatible interfaces. For OLE automation interfaces, the RCW can be generated automatically from a type library. For non-OLE automation interfaces, a developer may write a custom RCW and manually map the types exposed by the COM interface to .NET Framework-compatible types. 59. Can .NET Framework components be used from a COM program? Yes. Managed types you build today can be made accessible from COM, and in the common case the configuration is totally automatic. There are certain new features of the managed development environment that are not accessible from COM. For example, static methods and parameterized constructors cannot be used from COM. In general, it is a good idea to decide in advance who the intended user of a given type will be. If the type is to be used from COM, you may be restricted to using those features that are COM accessible. Depending on the language used to write the managed type, it may or may not be visible by default. Specifically, .NET Framework components are accessed from COM by using a COM callable wrapper (CCW). This is similar to an RCW (see previous question), but works in the opposite direction. Again, if the .NET Framework development tools cannot automatically generate the wrapper, or if the automatic behavior is not what you want, a custom CCW can be developed. 60. Can I use the Win32 API from a .NET Framework program? Yes. Using platform invoke, .NET Framework programs can access native code libraries by means of static DLL entry points. Here is an example of C# calling the Win32 MessageBox function: using System; using System.Runtime.InteropServices; class MainApp { [DllImport("user32.dll", EntryPoint="MessageBox")] public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType); public static void Main() { MessageBox( 0, "Hello, this is PInvoke in operation!", ".NET", 0 ); } } 61. What do I have to do to make my code work with the security system? Usually, not a thing—most applications will run safely and will not be exploitable by malicious attacks. By simply using the standard class libraries to access resources (like files) or perform protected operations (such as a reflection on private members of a type), security will be enforced by these libraries. The one simple thing application developers may want to do is include a permission request (a form of declarative security) to limit the permissions their code may receive (to only those it requires). This also ensures that if the code is allowed to run, it will do so with all the permissions it needs. Only developers writing new base class libraries that expose new kinds of resources need to work directly with the security system. Instead of all code being a potential security risk, code access security constrains this to a very small bit of code that explicitly overrides the security system.

62. Why does my code get a security exception when I run it from a network shared drive? Default security policy gives only a restricted set of permissions to code that comes from the local intranet zone. This zone is defined by the Internet Explorer security settings, and should be configured to match the local network within an enterprise. Since files named by UNC or by a mapped drive (such as with the NET USE command) are being sent over this local network, they too are in the local intranet zone. The default is set for the worst case of an unsecured intranet. If your intranet is more secure you can modify security policy (with the .NET Framework Configuration tool or the CASPol tool) to grant more permissions to the local intranet, or to portions of it (such as specific machine share names). 63. How do I make it so that code runs when the security system is stopping it? Security exceptions occur when code attempts to perform actions for which it has not been granted permission. Permissions are granted based on what is known about code; especially its location. For example, code run from the Internet is given fewer permissions than that run from the local machine because experience has proven that it is generally less reliable. So, to allow code to run that is failing due to security exceptions, you must increase the permissions granted to it. One simple way to do so is to move the code to a more trusted location (such as the local file system). But this won't work in all cases (web applications are a good example, and intranet applications on a corporate network are another). So, instead of changing the code's location, you can also change security policy to grant more permissions to that location. This is done using either the .NET Framework Configuration tool or the code access security policy utility (caspol.exe). If you are the code's developer or publisher, you may also digitally sign it and then modify security policy to grant more permissions to code bearing that signature. When taking any of these actions, however, remember that code is given fewer permissions because it is not from an identifiably trustworthy source—before you move code to your local machine or change security policy, you should be sure that you trust the code to not perform malicious or damaging actions. 64. How do I administer security for my machine? For an enterprise? The .NET Framework includes the .NET Framework Configuration tool, an MMC snap-in (mscorcfg.msc), to configure several aspects of the CLR including security policy. The snap-in not only supports administering security policy on the local machine, but also creates enterprise policy deployment packages compatible with System Management Server and Group Policy. A command line utility, CASPol.exe, can also be used to script policy changes on the computer. In order to run either tool, in a command prompt, change the current directory to the installation directory of the .NET Framework (located in %windir%\Microsoft.Net\Framework\v1.0.2914.16\) and type mscorcfg.msc or caspol.exe. 65. What’s the implicit name and type of the parameter that gets passed into the class’ set method? Value, and it‘s data type depends on whatever variable we‘re changing. 66. How do you inherit from a class in C#? Place a colon and then the name of the base class. Notice that it‘s double colon in C++. 67. Does C# support multiple inheritance? No, use interfaces instead. 68. When you inherit a protected class-level variable, who is it available to? Classes in the same namespace. 69. Are private class-level variables inherited? Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are.

69. Describe the accessibility modifier protected internal. It‘s available to derived classes and classes within the same Assembly (and naturally from the base class it‘s declared in). 70. C# provides a default constructor for me. I write a constructor that akes a string as a parameter, but want to keep the no parameter one. How many constructors should I write? Two. Once you write at least one constructor, C# cancels the freebie constructor, and now you have to write one yourself, even if there‘s no implementation in it. 71. What’s the top .NET class that everything is derived from? System.Object . 72. 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. 73. What does the keyword virtual mean in the method definition? The method can be over-ridden. 74. 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. 75. 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. 76. 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. 77. 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. 78. What’s an abstract class? A class that cannot be instantiated.A concept in C++ known as pure virtual method. A class that must be inherited and have the methods over-ridden. Essentially, it‘s a blueprint for a class without any implementation. 79. When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)? When at least one of the methods in the class is abstract. When the class itself is inherited from an abstract class, but not all base abstract methods have been over-ridden. 80. What’s an interface class? It‘s an abstract class with public abstract methods all of which must be implemented in the inherited classes.

81. 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. 82. Can you inherit multiple interfaces? Yes, why not. 83. And if they have conflicting method names? It‘s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you‘re okay. 84. 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. 85. How can you overload a method? Different parameter data types, different number of parameters, different order of parameters. 86. If a base class has a bunch of overloaded constructors, and an inherited class has another bunch of overloaded constructors, can you enforce a call from an inherited constructor to an arbitrary base constructor? Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class. 87. What’s the difference between System. String and System.StringBuilder classes? System. String is immutable; System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed 88. How big is the data type int in .NET? 32 bits. 89. How big is the char? 16 bits (Unicode). 90. How do you initiate a string without escaping each backslash? Put an @ sign in front of the double-quoted string. 91. What are valid signatures for the Main function? public static void Main () public static int Main () public static void Main ( string[] args ) public static int Main (string[] args ) 92. How do you initialize a two-dimensional array that you don’t know the dimensions of? int [ , ] myArray; //declaration myArray = new int [5, 8]; //actual initialization 93. What’s the access level of the visibility type internal? Current application. 94. What’s the difference between struct and class in C#? Structs cannot be inherited. Structs are passed by value, not by reference. Struct is stored on the stack, not the heap.

95. Explain encapsulation. The implementation is hidden, the interface is exposed. 96. What data type should you use if you want an 8-bit value that’s signed? sbyte . 97. Speaking of Boolean data types, what’s different between C# and /C++? There‘s no conversion between 0 and false, as well as any other number and true, like in C/C++. 98. Where are the value-type variables allocated in the computer RAM? Stack. 99. Where do the reference-type variables go in the RAM? The references go on the stack, while the objects themselves go on the heap. 100. What is the difference between the value-type variables and reference-type variables in terms of garbage collection? The value-type variables are not garbage-collected, they just fall off the stack when they fall out of scope, the reference-type objects are picked up by GC when their references go null. 101. How do you convert a string into an integer in .NET? Int32.Parse( string) 102. How do you box a primitive data type variable? Assign it to the object, pass an object. 103. Why do you need to box a primitive variable? To pass it by reference. 104. What’s the difference between Java and .NET garbage collectors? Sun left the implementation of a specific garbage collector up to the JRE developer, so their performance varies widely, depending on whose JRE you‘re using. Microsoft standardized on their garbage collection. 105. How do you enforce garbage collection in .NET? System.GC.Collect ( ); 106. Can you declare a C++ type destructor in C# like ~MyClass ()? Yes, but what‘s the point, since it will call Finalize(), and Finalize() has no guarantees when the memory will be cleaned up, plus, it introduces additional load on the garbage collector. 107. What’s different about namespace declaration when comparing that to package declaration in Java? No semicolon. 108. What’s the difference between const and read only? You can initialize read only variables to some runtime values. Let‘s say your program uses current date and time as one of the values that won‘t change. This way you declare public read only string DateT = new DateTime ().ToString (). 109. What does \a character do? On most systems, produces a rather annoying beep.

110. Can you create enumerated data types in C#? Yes. 111. What’s different about switch statements in C#? No fall-throughs allowed. 112. What happens when you encounter a continue statement inside the for loop? The code for the rest of the loop is ignored; the control is transferred back to the beginning of the loop. 113. Is goto statement supported in C#? How about Java? Gotos are supported in C# to the fullest. In Java goto is a reserved keyword that provides absolutely no functionality.

.Net Framework 2.0 Advantages:The .Net Framework (version 2.0) includes 51 assemblies. The .Net Framework (version 2.0) includes 18,619 types; 12,909 classes; 401,759 public methods; 93,105 public properties and 30,546 public events. It includes a new feature called Control State. Control state is similar to view state except that is used to preserve only critical information. For example the gridview control uses control state to store the selected row. Even if you disable the viewstate, the gridview control remembers which row is selected. We can precompile an entire ASP.Net application by using the aspnet_compiler.exe command line tool. If you precompile an application, users do not experience the compilation delay resulting from the first page request. Dynamic Compilation in detail:The entire contents of an ASP.NET page, including all script and HTML content, are compiled into a .net class. If we request a page that does not exist ASP.NET automatically compiles the page into a new class and stores the compiled class (the assembly) in the temporary ASP.NET files folder located in the following path \Windows\Microsoft.NET\Framework\[version]\Temporary ASP.Net files The next time when anyone request for the same page the page is not compiled again the previous one is executed even if you request the page after three years. When the class is added to the Temporary ASP.NET files folder, a file dependency created between the class and the original ASP.NET page. If the ASP.NET page is modified in any way, the corresponding .net class is automatically deleted. The next time when someone request the page, the Framework automatically compiles the modified page source into a new .net class. This process is called Dynamic compilation. Dynamic compilation enables ASP.Net application o support thousands of simultaneous users. Note:We can disable dynamic compilation for a single page, the pages in folder, or an entire website with the CompilationMode attribute. Disabling the compilation is useful when thousands of pages in a website and you do not want to load an

assembly into memory for every page. When the compilation attribute is said to the value Never, the page is never compiled and an assembly is never generated for the page. The page is interpreted at runtime. We cannot disable the compilation code that includes server side code. Literal Control:We can use literal control to display text or HTML content in a browser. It does not render its content inside a <span> tag. It does not support CSS class or Back color properties. However it supports the mode property that is not supported by the label control. Using Client Scripts with Button Controls:<asp: Button id = ―btnDelete‖ Text=‖Delete‖ onclick=‖btnDelete_Click‖ onclientclick=‖return confirm (‗Are you sure?‘);‖ runat =‖server‖/> <asp: Button id = ―btnSubmit‖ Text = ―Submit‖ onmouseover=‖this.value=‘click here!‘‖ onmouseout=‖this.value=‘Submit‘‖ runat=‖server‖/> Mater Pages:You can nest content place holder controls in a master page. If you do this, then you have the option of overriding greater or smaller areas of content in master page. You cannot work with nested master pages in visual web developer while in design view. If you need to nest master pages, then you need to stick to source view. Relative URLs used by ASP.NET controls in master page are automatically reinterpreted relative to master page. This process of reinterpretation is called rebasing. Only ASP.NET control properties decorated with URL property attribute are rebased. You will receive null reference exception if you use the Page.Header property when the master page does not contain a server-side <head> tag. Themes:The contents of a theme folder are automatically compiled in the background into a new class. So you want to be careful not to name a theme with a class name that conflicts with an existing class name in your project. The textbox control includes a Runat=‖server‖ attribute, but it does not include an ID attribute. You must always include a Runat attribute, but you can never include the ID attribute when declaring a control in a skin. We can not create a skin that applies to the properties of a user control. However, you can skin the controls contained in a user control. AJAX and User Controls:AJAX (Asynchronous JavaScript and XML) enables you to update content in a page without posting back to the server. In the ASP.NET Framework, AJAX is referred to as ‗client callbacks‘. To add AJAX support to a user control, you must implement the ICallBackEventHandler interface and add the necessary JavaScript scripts to process the results of the AJAX call.

Steps for implementing AJAX:? Create a client script for invoking the AJAX call. You can get this script with the Page.ClientScript.GetCallbackEventReference () method. ? Create a sever methods named RaiseCallbackEvent() and GetCallbackResult(), which returns a string value from the server. ? Create a client method that receives the value from the server RaiseCallbackEvent() method and does something with the value. 1.Which controls do not have events? Ans:Timer control. 2.What is the maximum size of the textbox? Ans:65536. 3.Which property of the textbox cannot be changed at runtime? Ans:Locked Porperty. 4.Which control cannot be placed in MDI? Ans:The controls that do not have events. 5.Difference between a sub and a function. Ands -A Sub Procedure is a method will not return a value -A sub procedure will be defined with a ―Sub‖ keyword Sub ShowName(ByVal myName As String) Console.WriteLine(‖My name is: ‖ & myName) End Sub -A function is a method that will return value(s). -A function will be defined with a ―Function‖ keyword Function FindSum(ByVal num1 As Integer, ByVal num2 As Integer) As Integer Dim sum As Integer = num1 + num2 Return sum End Function 6.Explain manifest & metadata. Ands: Manifest is metadata about assemblies. Metadata is machine-readable information about a resource, or ―‖data about data.‖ In .NET, metadata includes type definitions, version information, external assembly references, and other standardized information. 7.Difference between imperative and interrogative code Ans. There are imperative and interrogative functions and I think they are talking about that. Imperative functions are the one which return a value while the interrogative functions do not return a value. 8.What are the two kinds of properties Ans. Two types of properties in .Net: Get & Set Two kind of properties are scalar properties and indexed properties 9.Explain constructor Ans. Constructor is a method in the class which has the same name as the class (in VB.Net its New()). It initialises the member attributes whenever an instance of the class is created.

10.Describe ways of cleaning up objects Ans. The run time will maintain a service called as garbage collector. this service will take care of deallocating memory corresponding to objects.it works as a thread with least priority.when application demenads for memory the runtime will take care of setting the high priority for the garbage collector,so that it will be called for execution and memory will be released.the programmer can make a call to garbage colector by using GC class in system name space. 11. what are value types and reference types? Ans. Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort Value types are stored in the Stack Reference type - class, delegate, interface, object, string Reference types are stored in the Heap 12.How can you clean up objects holding resources from within the code? Ands Call the dispose method from code for clean up of objects 13.Explain the life cycle of an ASP .NET page. Life cycle of ASP.Net Web Form Page Request >> Start >> Page Init >> Page Load >> Validation >> PostBack Event Handling >> Page Rendering >> Page Unload Page Request - When the page is requested ASP.Net determines whether the page is to be parsed and compiled or a cached verion of the page is to be sent without running the page. Start - Page propertied REQUEST and RESPONSE are SET, if the page is pastback request then the IsPostBack property is SET and in addition to this UICulture property is also SET. Page Initilization - In this the UniqueID of each property is SET. If the request was postback the data is not yet loaded from the viewstate. Page Load - If it was a postback request then the data gets loaded in the control from the ViewState and control property are set. Validation - If any control validation present, they are performed and IsValid property is SET for each control. PostBack Event Handling - If it was a postback request then any event handlers are called. Page Rendering - Before this the viewstate is saved from the page and RENDER method of each page is called. Page Unload - Page is fully rendered and sent to the client(Browser) and is discarded. Page property RESPONSE and REQUEST are unloaded. 14) .Net architecture? The order starting from the bottom 1. CLR (Common Language Runtime) 2. .Net framework base classe 3. ASP.Net Web Form / Windows Form 15) What are object-oriented concepts? Ans. Inheritance Abstraction Polymorphism Encapsulation

16. How do you create multiple inheritance in c# and .NET? Ans. Use interfaces public class MyTest: IPaidInterface, ISoldInterface 17. When is web.config called? Ans. Web.config is an xml configuration file. It is never directly called unless we need to retrieve a configurations setting. 18. How many weg.configs can an application have? Ans. One. 19. How do you set language in weg.config? Ans. defaultLanguage=‖vb‖: This specifies the default code language. debug=‖true‖: This specifies that the application should be run in debug mode 20. What does connection string consist of? Ans. Server, user id, password, database name. 21. Where do you store connection string? Ans. Web.config 22. What is abstract class? Ans. An abstract class is a class that cannot be instantiated. Its purpose is to act as a base class from which other classes may be derived. 23. What is difference between interface inheritance and class inheritance? Ans. We can only inherit from one class but multiple interfaces. In addition, an interface does not contain any implementation it just contains a series of signatures. 24. What are the collection classes? Ans. Queue, Stack, BitArray, HashTable, LinkedList, ArrayList, Name ValueCollection, Array, SortedList , HybridDictionary, ListDictionary, StringCollection, StringDictionary 25. What are the types of threading models? Ans. Single Threading: This is the simplest and most common threading model where a single thread corresponds to your entire application‘s process. Apartment Threading (STA): This allows multiple threads to exist in a single application. In single threading apartment (STA), each thread is isolated in it‘s own apartment. The process may contain multiple threads (apartments) however when an object is created in a thread (i.e. apartment) it stays within that apartment. If any communication needs to occur between different threads (i.e. different apartments) then we must marshal the first thread object to the second thread. Free Threading: The most complex threading model. Unlike STA, threads are not confined to their own apartments. Multiple treads can make calls to the same methods and same components at the same time. 26. What inheritance does VB.NET support? Ans. Single inheritance using classes or multiple inheritance using interfaces.

27. What is a runtime host? Ans. The runtime host is the environment in which the CLR is started and managed. 28. Describe the techniques for optimising your application? Ans: Avoid round-trips to server. Perform validation on client. . Save viewstate only when necessary. . Employ caching. . Leave buffering on unless there is a dire need to disable it. . Use connection pooling. . Use stored procedures instead of in-line SQL or dynamic SQL. 29. Differences between application and session Ans. The session object maintains state on a per client basis whereas the application object is on a per application basis and is consistent across all client requests. 30. What is web application virtual directory? Ans. A virtual directory appears to client browsers as though it were contained in a Web server‘s root directory, even though it can physically Reside somewhere else. 31. What is isPostback property? This property is used to check whether the page is being loaded and accessed for the first time or whether the page is loaded in response to the client postback. Example:Consider two combo boxes In one lets have a list of countries In the other, the states. Upon selection of the first, the subsequent one should be populated in accordance. So this requires postback property in combo boxes to be true. 32. Where do you store connection string? Ans. Database connection string can be stored in the web config file. The connection string can be stored in the WEB.Config file under element 33. What does connection string consist of? Ans. The connection string consists of the following parts: In general: Server: Whether local or remote. Uid: User Id (sa-in sql server) Password: The required password to be filled-in here Database: The database name. 34. What are the collection classes? Ans. The .NET Framework provides specialized classes for data storage and retrieval. These classes provide support for stacks, queues, lists, and hash tables. 35. What is isPostback property? Ans. This property is used to check whether the page is being loaded and accessed for the first time or whether the page is loaded in response to the client postback. Example: Consider two combo boxes

In one lets have a list of countries In the other, the states. Upon selection of the first, the subsequent one should be populated in accordance. So this requires postback property in combo boxes to be true. 36. What are Abstract base classes? Ans. Abstact Class is nothing but a true virtual class.. This class cannot be instantiated instead it has to be inherited. The method in abstract class are virtual and hence they can be overriden in the child class. 37.What is difference between interface inhertance and class inheritance? Ans. Interface inheritance: 1. The accessibility modifier in Interface is public by defalut. 2. All the methods defined in the interface class should be oveririden in the child class. Class Inheritance 1. There is not restriction on the acessibility modifier in a class. 2. Only the method that are defined virtual should be overriden. 38. ASP.NET OBJECTS? Ans. Application,Request,Responce,server and session 39. How do you get the value of a combo box in Javascript? Ans. document.form_name.element_name.value 40. Why do we use Option Explicit? Ans:- Correct answer is - This statement force the declaration of variables in VB before using them. 41. How do you create a recordset object in VBScript? Ans. //First of all declare a variable to hold the Recordset object, ex-Dim objRs //Now, Create this varible as a Recordset object, exSet objRs=Server.CreateObject(ADODB.RECORDSET) 42. What is a class in CSS? Ans. A class allows you to define different style characteristics to the same HTML element. class is a child to the id, id should be used only once, a css class can be used multiple times: div id=‖banner‖ p class=‖alert‖ 43. When inserting strings into a SQL table in ASP what is the risk and how can you prevent it? Ans. SQL Injection, to prevent you probably need to use Stored Procedures instead of inline/incode SQL 44. what is boxing? what is unboxing? what is deep copy & shallow copy? Ans. Converting the value type into reverence type is call boxing. Ans. Converting the reference type into value type is call unboxing.

When an object of value type is assigned with another, the data itself is copied from one object to another. Suppose there are two integer variables, count1 and count2. Further suppose that count1 contains the value 5 and that count2 is assigned the value of count1. count1 = 5; count2 = count1; Both count1 and count2 now contain their own copies of the data, in this case, the value 5. They are independent. If count1 is now assigned the value 6, count2 will still contain the value 5. This type of copy is referred to as a deep copy. The value itself is copied. If count1 is now assigned the value 6, count2 will still contain the value 5. This type of copy is referred to as a deep copy. For reference types copies work differently. Remember that a reference type consists of two parts: the data on the heap and the address of the data stored in the reference variable itself on the stack. When one reference variable is assigned to another, the address stored in the first is copied to the second. They both then refer to the same data content on the heap. This is referred to as a shallow copy. 45. What will be output for the given code? Dim I as integer = 5 Do I=I+2 Response.Write (I & \‖ \‖) Loop Until I > 10 Ans. o/p: It generates error because of \‖ \‖. (VB.NET) 46. What is the output for the following code snippet: public class testClass { public static void Main(string[] args) { System.Console.WriteLine(args[1]); }//end Main }//end class testClass

Session Never Expired --------------------------On Code Project, I found something very useful in which the author was discussing a very beautiful idea for preventing session timeouts Idea was to call the following function in the Page Load() event. private void ReconnectSession() { int int_MilliSecondsTimeOut = (this.Session.Timeout * 60000) - 30000; string str_Script = @" <script type='text/javascript'> function Reconnect() { window.open('reconnect.aspx','reconnect','width=5,height=5,top=180 0,left=1800,scrollbars=no,showintaskbar=no'); } window.setInterval('Reconnect()',"+int_MilliSecondsTimeOut.ToString()+ @"); </script> "; this.Page.RegisterClientScriptBlock("Reconnect", str_Script); } Using the above code the page will restore the session variables 30 seconds prior to session timeout

specified in the web.config file. What it does is, calling a javascript function that opens a page in a new window. This javascript function call is "scheduled" so that the it will happen when the session is going to expire in 30 seconds. window.setInterval() is used for that purpose. In my application, some details were to be retrieved from the database at the time of session renewal. Reconnect.aspx is the page in which these things are done. You can put your own code in that page. In the actual article on Code Project, the author was trying to embed the page within a java script Image() tag. This was not suitable for my application. So 30 seconds prior to session expiry, I am opening a window with the above properties and after refreshing the session variables, it will close automatically. Since that idea is pretty straight forward, we are not discussing it here. The trickiest part of the game is yet to come. If the application consists of more than 50 or 100 pages, in order to avoid pasting the code in every page, we can make use of the inheritance feature of web forms. As we know, all the web forms are inherited from the System.Web.UI.Page class. We can add a class file to the project that inherits from System.Web.UI.Page class. public class YourNewPageClass : System.Web.UI.Page

Then add the following code to the class. override protected void OnInit(EventArgs e) { base.OnInit(e); if (Context.Session != null) { int int_MilliSecondsTimeOut = (this.Session.Timeout * 60000) - 30000; string str_Script = @" <script type='text/javascript'> function Reconnect() { window.open('reconnect.aspx','reconnect','width=5,height=5,top=1800,left=1800,scrollbars=no,showintask bar=no'); } window.setInterval('Reconnect()',"+int_MilliSecondsTimeOut.ToString()+ @"); </script>"; this.Page.RegisterClientScriptBlock("Reconnect", str_Script); } } Solution 2 I recently came across some code which attempted to fix this problem but that was unsuccessful because the author had forgotten the issue of client side caching. Add to your page the following code: private void Page_Load(object sender, System.EventArgs e) { this.AddKeepAlive(); } private void AddKeepAlive() { int int_MilliSecondsTimeOut = (this.Session.Timeout * 60000) - 30000; string str_Script = @" <script type='text/javascript'> //Number of Reconnects var count=0; //Maximum reconnects setting var max = 5; function Reconnect()

{ count++; if (count < max) { window.status = 'Link to Server Refreshed ' + count.toString()+' time(s)' ; var img = new Image(1,1); img.src = 'Reconnect.aspx'; } } window.setInterval('Reconnect()',"+ _ int_MilliSecondsTimeOut.ToString()+ @"); //Set to length required </script> "; this.Page.RegisterClientScriptBlock("Reconnect", str_Script); } This code will cause the client to request within 30 seconds of the session timeout the page Reconnect.aspx.

The Important Part Now this works the first time but if the page is cached locally then the request is not made to the server and the session times out again, so what we have to do is specify that the page Reconnect.aspx cannot be cached at the server or client. This is done by creating the Reconnect.aspx page with this content: <%@ OutputCache Location="None" VaryByParam="None" %> <html> </html> The OutputCache directive prevents this from being cached and so the request is made each time. No code behind file will be needed for this page so no @Page directive is needed either. 1) What is CLS (Common Language Specificaiton)? It provides the set of specificaiton which has to be adhered by any new language writer / Compiler writer for .NET Framework. This ensures Interoperability. For example: Within a ASP.NET application written in C#.NET language, we can refer to any DLL written in any other language supported by .NET Framework. As of now .NET Supports around 32 languages. 2) What is CTS (Common Type System)? It defines about how Objects should be declard, defined and used within .NET. CLS is the subset of CTS. 3) What is Boxing and UnBoxing? Boxing is implicit conversion of ValueTypes to Reference Types (Object) . UnBoxing is explicit conversion of Reference Types (Object) to its equivalent ValueTypes. It requires type-casting. 4) What is the difference between Value Types and Reference Types? Value Types uses Stack to store the data where as the later uses the Heap to store the data. 5) What are the different types of assemblies available and their purpose? Private, Public/shared and Satellite Assemblies. Private Assemblies : Assembly used within an application is known as private assemblies Public/shared Assemblies : Assembly which can be shared across applicaiton is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly Cache). Satellite Assemblies : These assemblies contain resource files pertaining to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages.

6) Is String is Value Type or Reference Type in C#? String is an object (Reference Type).

Editing JavaScript Using Visual Studio .NET
Mark Wagner Castle Rock Software, LLC http://blogs.crsw.com.mark December 22, 2004 Summary: Use the Visual Studio .NET development environment as your JavaScript editor. Technologies and Tools   JavaScript Visual Studio .NET

As a .NET developer, I have become very comfortable with the Visual Studio .NET development environment. As a result of my profession I spend most of my time working with this application. I have recently increased my use of JavaScript and wanted an easy-to-use editor that wouldn't take long for me to become productive using. I have debugged JavaScript with .NET on and off for a while now, but never did I really need to work solely with JavaScript. Usually, I am working within the context of an ASP.NET sever-side project. The purpose of a scripting language such as JavaScript, is to provide a flexible, forgiving language to accomplish relatively simple code logic. My primary intent was simply to use Visual Studio .NET as my JavaScript editor in order to take advantage of the built-in Intellisense and debugging it provides; and I am very comfortable with VS .NET and liked the idea of having a single development environment. A significant portion of my testing and debugging will take place within the browser (Internet Explorer, Netscape, and others), but Visual Studio does have a few nice tools that can be used to debug such as the watch window. Creating a new JavaScript Project I begin by creating a new "JavaScript" project by selecting the File > New > Project menu option. I happen to use C# when I code, so I selected the C# Projects folder; however, you could just as easily select the Visual Basic Projects. Once you have selected your folder, select the Empty Web Project icon and then specify the name of your project. In the sample below my project name is MyJavaScriptProject. This will create a simple web project with no files in it.

Next, I add a new HTML page to my project. Below is a sample of my simple completed HTML page. When you add your HTML page, it will be empty compared to my example below. As you inspect the HTML code below you will find it is a very simple HTML page with mostly javascript code contained within script tags. Keep in mind, you can edit javascript (.js files) files as well. However, since javascript files do not have a context by themselves, you will not get the full Intellisense available. This is because the JavaScript code in the .js files is not within the context of an HTML document. For example, you will not get the document object within your Intellisense. Although you can still code using the document object, I like having the Intellisense available. At least for

now.

Quick Note Make sure you allow (enable/disable) the JavaScript debugging in your Internet Explorer options. These are usually in the Advanced section. This will allow any JavaScript errors that occur while you test in your Internet Explorer browser to attach to your Visual Studio .NET debugging environment. Intellisense The Visual Studio .NET HTML editor will provide Intellisense. The use of Intellisense plays a major factor in my productivity. Without it, I find myself digging through online help and books much more than I would like. Even better, Visual Studio .NET provides Intellisense for the browser you want. You do this by setting the targetSchema property of the HTML document in the properties dialog. Below you can see the available schemas to chose from. I find myself switching between Internet Explorer 5.0 and Netscape Navigator 4.0 options. This allows me to easily use Intellisense when creating browser specific javascript code. Changing this targetSchema property tells the Visual Studio .NET editor what browser I would like my Intellisense to be compatible with. When testing javascript code specific to Netscape I select the Netscape Navigator 4.0 option. Then for example, when I type the javascript keyword/object document followed by the usual dot (period), I get the Intellisense populated with all the Netscape Navigator 4.0 compliant properties and methods. The same is true when I select the Internet Explorer 5.0 option. An important point to remember is that JavaScript is not strongly typed. Because of this, the Visual Studio .NET editor cannot provide Intellisense for your JavaScript variables and functions. However, your declared var-iables will appear, which is kinda nice. I am not familiar with any of the other more popular JavaScript editors. I expect they may try to perform some sort of design-time variable typing via reflection. That would be purely a guess on the editors part, yet while keeping this point in mind, any help an editor provides is of benefit to the developer.

Testing My JavaScript I can test my "JavaScript" project using the Start Without Debugging menu option, or Ctrl+F5. This may be more of a convenience than a necessity. Alternatively, I could simply open my test browser (IE, NS, Firefox, etc.) and point the url to my local project. I typically just press the Ctrl+F5 keys. Also, don't forget to set the default page for your project to your HTML page first.

Conclusion My appreciation for JavaScript continues to grow. This is especially true as the standardization and functionality continues to improve between Internet Explorer, Netscape Navigator, and now Firefox. I will admit that Visual Studio .NET is probably not the best JavaScript editor available. However, it is much better than using a simple text editor, which is often done. I have not taken the time to look into editors and debuggers for JavaScript. I expect they provide more for the JavaScript developer since that is what they are specifically designed for. I have personally not felt the need to dedicate time in learning the "best of's" for each JavaScript editor available. However, I would appreciate recommendations or suggestions you may have. GetPageHTML - Get the HTML code for a given URL public class SampleCode { public SampleCode() {} // // // // Download the HTML source code at the specified URL You can optionally specify the username/password credentials, in case the page uses Basic Authentication Returns a null string if any error occurs

public static string GetHtmlPageSource(string url)

{ return GetHtmlPageSource(url, null, null); } public static string GetHtmlPageSource(string url, string username, string password) { System.IO.Stream st = null; System.IO.StreamReader sr = null; try { // make a Web request System.Net.WebRequest req = System.Net.WebRequest.Create(url); // if the username/password are specified, use these credentials if( username != null && password != null ) req.Credentials = new System.Net.NetworkCredential(username, password); // get the response and read from the result stream System.Net.WebResponse resp = req.GetResponse(); st = resp.GetResponseStream(); sr = new System.IO.StreamReader(st); // read all the text in it return sr.ReadToEnd(); } catch(Exception ex) { return string.Empty; } finally { // always close readers and streams sr.Close(); st.Close(); } } }

C# Interview Questions
This is a list of questions I have gathered from other sources and created myself over a period of time from my experience, many of which I felt where incomplete or simply wrong. I have finally taken the time to go through each question and correct them to the best of my ability. However, please feel free to post feedback to challenge, improve, or suggest new questions. I want to thank those of you that have contributed quality questions and corrections thus far. There are some question in this list that I do not consider to be good questions for an interview. However, they do exist on other lists available on the Internet so I felt compelled to keep them easy access. General Questions

1.

Does C# support multiple-inheritance? No. Who is a protected class-level variable available to? It is available to any sub-class (a class inheriting this class). Are private class-level variables inherited? Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited. Describe the accessibility modifier “protected internal”. It is available to classes that are within the same assembly and derived from the specified base class. What’s the top .NET class that everything is derived from? System.Object. What does the term immutable mean? The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory. What’s the difference between System.String and System.Text.StringBuilder classes? System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed. What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created. Can you store multiple data types in System.Array? No.

2.

3.

4.

5.

6.

7.

8.

9.

10. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object. 11. How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods. 12. What’s the .NET collection class that allows an element to be accessed using a unique key? HashTable. 13. What class is underneath the SortedList class? A sorted HashTable. 14. Will the finally block get executed if an exception has not occurred? Yes. 15. What’s the C# syntax to catch any possible exception? A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

16. Can multiple catch blocks be executed for a single try statement? No. Once the proper catch block processed, control is transferred to the finally block (if there are any). 17. Explain the three services model commonly know as a three-tier application. Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).

Class Questions 1. What is the syntax to inherit from a class in C#? Place a colon and then the name of the base class. Example: class MyNewClass : MyBaseClass Can you prevent your class from being inherited by another class? Yes. The keyword ―sealed‖ will prevent the class from being inherited. Can you allow a class to be inherited, but prevent the method from being over-ridden? Yes. Just leave the class public and make the method sealed. 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. When do you absolutely have to declare a class as abstract? 1. When the class itself is inherited from an abstract class, but not all base abstract methods have been overridden. 2. When at least one of the methods in the class is abstract. What is an interface class? Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes. Why can’t you specify the accessibility modifier for methods inside the interface? They all must be public, and are therefore public by default. Can you inherit multiple interfaces? Yes. .NET does support multiple interfaces. What happens if you inherit multiple interfaces and they have conflicting method names? It‘s up to you to implement the method inside your own class, so implementation is left entirely up to you. This might cause a problem on a higher-level scale if similarly named methods from different interfaces expect different data, but as far as compiler cares you‘re okay. To Do: Investigate

2.

3.

4.

5.

6.

7.

8.

9.

10. What’s the difference between an interface and abstract class? In an interface class, all methods are abstract - there is no implementation. In an abstract class some methods can be concrete. In an interface class, no accessibility modifiers are allowed. An abstract class may have accessibility modifiers. 11. What is the difference between a Struct and a Class? Structs are value-type variables and are thus saved on the stack, additional overhead but faster retrieval. Another difference is that structs cannot inherit.

Method and Property Questions 1. What’s the implicit name of the parameter that gets passed into the set method/property of a class? Value. The data type of the value parameter is defined by whatever data type the property is declared as. What does the keyword “virtual” declare for a method or property? The method or property can be overridden. How is method overriding different from method overloading? When overriding a method, you change the behavior of the method for the derived class. Overloading a method simply involves having another method with the same name within the class. Can you declare an override method to be static if the original method is not static? No. The signature of the virtual method must remain the same. (Note: Only the keyword virtual is changed to keyword override) What are the different ways a method can be overloaded? Different parameter data types, different number of parameters, different order of parameters. If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor? Yes, just place a colon, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.

2.

3.

4.

5.

6.

Events and Delegates 1. What’s a delegate? A delegate object encapsulates a reference to a method. What’s a multicast delegate? A delegate that has multiple handlers assigned to it. Each assigned handler (method) is called.

2.

XML Documentation Questions 1. Is XML case-sensitive? Yes. What’s the difference between // comments, /* */ comments and /// comments? Single-line comments, multi-line comments, and XML documentation comments. How do you generate documentation from the C# file commented properly with a commandline compiler? Compile it with the /doc switch.

2.

3.

Debugging and Testing Questions 1. What debugging tools come with the .NET SDK? 1. CorDBG – command-line debugger. To use CorDbg, you must compile the original C# file using the /debug switch. 2. DbgCLR – graphic debugger. Visual Studio .NET uses the DbgCLR. What does assert() method do? In debug compilation, assert takes in a Boolean condition as a parameter, and shows the error dialog if the condition is false. The program proceeds without any interruption if the condition is true. What’s the difference between the Debug class and Trace class? Documentation looks the same. Use Debug class for debug builds, use Trace class for both debug and release builds. Why are there five tracing levels in System.Diagnostics.TraceSwitcher? The tracing dumps can be quite verbose. For applications that are constantly running you run the risk of overloading the machine and the hard drive. Five levels range from None to Verbose, allowing you to fine-tune the tracing activities. Where is the output of TextWriterTraceListener redirected? To the Console or a text file depending on the parameter passed to the constructor. How do you debug an ASP.NET Web application? Attach the aspnet_wp.exe process to the DbgClr debugger. What are three test cases you should go through in unit testing? 1. Positive test cases (correct data, correct output). 2. Negative test cases (broken or missing data, proper handling). 3. Exception test cases (exceptions are thrown and caught properly). Can you change the value of a variable while debugging a C# application? Yes. If you are debugging via Visual Studio.NET, just go to Immediate window.

2.

3.

4.

5.

6.

7.

8.

ADO.NET and Database Questions 1. What is the role of the DataReader class in ADO.NET connections? It returns a read-only, forward-only rowset from the data source. A DataReader provides fast access when a forward-only sequential read is needed. What are advantages and disadvantages of Microsoft-provided data provider classes in ADO.NET? SQLServer.NET data provider is high-speed and robust, but requires SQL Server license purchased from Microsoft. OLE-DB.NET is universal for accessing other sources, like Oracle, DB2, Microsoft Access and Informix. OLE-DB.NET is a .NET layer on top of the OLE layer, so it‘s not as fastest and efficient as SqlServer.NET. What is the wildcard character in SQL? Let‘s say you want to query database with LIKE for all employees whose name starts with La. The wildcard character is %, the proper query with LIKE would involve ‗La%‘.

2.

3.

4.

Explain ACID rule of thumb for transactions. A transaction must be: 1. Atomic - it is one unit of work and does not dependent on previous and following transactions. 2. Consistent - data is either committed or roll back, no ―in-between‖ case where something has been updated and something hasn‘t. 3. Isolated - no transaction sees the intermediate results of the current transaction). 4. Durable - the values persist if the data had been committed even if the system crashes right after. What connections does Microsoft SQL Server support? Windows Authentication (via Active Directory) and SQL Server authentication (via Microsoft SQL Server username and password). Between Windows Authentication and SQL Server Authentication, which one is trusted and which one is untrusted? Windows Authentication is trusted because the username and password are checked with the Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction. What does the Initial Catalog parameter define in the connection string? The database name to connect to. What does the Dispose method do with the connection object? Deletes it from the memory. To Do: answer better. The current answer is not entirely correct. What is a pre-requisite for connection pooling? Multiple processes must agree that they will share the same connection, where every parameter is the same, including the security settings. The connection string must be identical.

5.

6.

7.

8.

9.

Assembly Questions 1. How is the DLL Hell problem solved in .NET? Assembly versioning allows the application to specify not only the library it needs to run (which was available under Win32), but also the version of the assembly. What are the ways to deploy an assembly? An MSI installer, a CAB archive, and XCOPY command. What is a satellite assembly? When you write a multilingual or multi-cultural application in .NET, and want to distribute the core application separately from the localized modules, the localized assemblies that modify the core application are called satellite assemblies. What namespaces are necessary to create a localized application? System.Globalization and System.Resources. What is the smallest unit of execution in .NET? an Assembly.

2.

3.

4.

5.

6.

When should you call the garbage collector in .NET? As a good rule, you should not call the garbage collector. However, you could call the garbage collector when you are done using a large object (or set of objects) to force the garbage collector to dispose of those very large objects from memory. However, this is usually not a good practice. How do you convert a value-type to a reference-type? Use Boxing. What happens in memory when you Box and Unbox a value-type? Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

7.

8.

1. Explain the differences between Server-side and Client-side code? ANS: Server side code will execute at server end all the business logic will execute at server end where as client side code will execute at client side at browser end. 2. What type of code (server or client) is found in a Code-Behind class? ANS : Server side. 3. Should validation (did the user enter a real date) occur server-side or client-side? Why? ANS : client side . there is no need to go to validate user input. If it relates to data base validation we need to validate at server side. 4. What does the "EnableViewState" property do? Why would I want it on or off? ANS: IT keeps the data of the control during post backs. if we turn off the values should not populate during server round trip. 5. What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other? ANS: Server.Trnasfer will prevent round trip. it will redirect pages which or in the same directory. NO way to pass the query strings . Thru http context we can able to get the previous page control values. Response.Redirect : There is a round trip to process the request. We can redirect to any page external / internal other than aspx. We can pass the query string thru which we can manage sessions. 6. Can you give an example of when it would be appropriate to use a web service as opposed to a nonserviced .NET component ANS : Web services are best suite for Hetrogenious environment. Remoting is best suite for Homogenious environment. The systems that under CLR.

7. Let's say I have an existing application written using Visual Studio 6 (VB 6, InterDev 6) and this application utilizes Windows 2000 COM+ transaction services. How would you approach migrating this application to .NET We need to have Wrapper to communicate COM components in .net. and vis versa CCW : Com Callable wrapper. RCW : RUN time callable wrapper. 8. Can you explain the difference between an ADO.NET Dataset and anADO Recordset?\ ANS : DIsconnected architechure . Maintainace relation schemas. MUtilple table grouping. Connected one . 9. Can you give an example of what might be best suited to place in the Application_Start and Session_Start subroutines? ANS: APplication_start need for global variable which are available over the application. Sesssion_Start : login dependent ( user dependent)

10. If I'm developing an application that must accomodate multiple security levels though secure login and my ASP.NET web appplication is spanned across three web-servers (using round-robbin load balancing) what would be the best approach to maintain login-in state for the users? ANS : Database Support. or Thru state service. 11. What are ASP.NET Web Forms? How is this technology different than what is available though ASP (1.0-3.0)? ANS : ASP . Interprepter.. use the script engine. ASP.Net Compiled. 12. How does VB.NET/C# achieve polymorphism? ANS : Function overloading. Operator overloading. 11. Can you explain what inheritance is and an example of when you might use it? ANS : Heridity. Use the existing functionality along with its own properities. 13. How would you implement inheritance using VB.NET/C#? ANS: Derived Class : Basecalss VB.NEt : Derived Class Inherits Baseclass 14. Whats an assembly ANS : A Basic unit of executable code > Which contains : Manifest - Meta data versioning , Calture , IL, Reference 15. Describe the difference between inline and code behind - which is best in a loosely coupled solution Tightly coupled - INLINE ANS: inline function bind at compile time can write in aspx page with in <% %> . 17. Explain what a diffgram is, and a good use for one ANS : is an xml grammer. it talk about state of node in xml file. 18. Where would you use an iHTTPModule, and what are the limitations of any approach you might take in implementing one ANS: Preprocessing before going to IIS. 20. What are the disadvantages of viewstate/what are the benefits ANS : IT can be hacked . page is size is heavy. 21 Describe session handling in a webfarm, how does it work and what are the limits Session - mode State sever OUtprocess sql 22. How would you get ASP.NET running in Apache web servers - why would you even do this? ANS: ---- Install Mod_AspDotNet Add at the end of C:\Program Files\Apache Group\Apache2\conf\httpd.conf the following lines 23. Whats MSIL, and why should my developers need an appreciation of it if at all? ANS : Microsoft Intermeidate lanaguage. which is the out put for all the .net supported languages after comiplation will produce. Appreciation for cross language support. 24. In what order do the events of an ASPX page execute. As a developer is it important to undertsand these events? ANS : INIT, PageLoad, Prerender , UNload. 25. Which method do you invoke on the DataAdapter control to load your generated dataset with data? Fill() 26. Can you edit data in the Repeater control? NO 27. Which template must you provide, in order to display data in a Repeater control? ITemtemplate

28. How can you provide an alternating color scheme in a Repeatercontrol? AlternateItemTemplate 29. What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeatercontrol? Datasource, DataBind 30. What base class do all Web Forms inherit from? System.Web.UI.Page 31. What method do you use to explicitly kill a user s session? abondon() 32 How do you turn off cookies for one page in your site? disablecookies. 33. Which two properties are on every validation control? control to validate, error message 34. What tags do you need to add within the asp:datagrid tags to bind columns manually? autogenerated columns is set to false 35. How do you create a permanent cookie? Cooke = ne cookee(). cooke.adddate. 36. What tag do you use to add a hyperlink column to the DataGrid? hyper link column 37. What is the standard you use to wrap up a call to a Web service -----------38. Which method do you use to redirect the user to another page without performing a round trip to the client? server.transfer 39. What is the transport protocol you use to call a Web service SOAP http 40. True or False: A Web service can only be written in .NET false 41. What does WSDL stand for? webservice discription language. it is used to generate for proxy( server object) 42. What property do you have to set to tell the grid which page to go to when using the Pager object? Page Index. 43. Where on the Internet would you look for Web services? UDDI 44. What tags do you need to add within the asp:datagrid tags to bind columns manually. Autogenerate columns 45. Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box? datatext datavalue 46. How is a property designated as read-only? get 47. Which control would you use if you needed to make sure the values in two different controls matched? compare filed validator 48. True or False: To test a Web service you must create a windows application or Web application to consume this service? no 49. How many classes can a single .NET DLL contain?


								
To top