Posts

Showing posts from September, 2012

ASP Dot net - Bits and Stuff

1. What is the sequence in which ASP.NET events are processed ? Following is the sequence in which the events occur : Page_Init. Page_Load. Control events. Page_Unload event. Page_Init event only occurs when first time the page is started, but Page_Load occurs in subsequent request of the page   2. In which event are the controls fully loaded ? Page_Load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but you will see that viewstate is not fully loaded during this event   3. How can we identify that the Page is PostBack? Page object has a “IsPostBack” property which can be checked to know that is the page posted back. 4. How does ASP.NET maintain state in between subsequent request? Refer caching chapter. Caching Concepts 5. What is event bubbling? Server controls like Datagrid, DataList, Repeater can have other child controls inside them. Example DataGrid can have combo box inside datagrid. The...

Object Oriented Programming

What is Object Oriented Programming? It is a problem solving technique to develop software systems. It is a technique to think real world in terms of objects. Object maps the software model to real world concept. These objects have responsibilities and provide services to application or other objects. What’s an Object? It is a basic unit of a system. An object is an entity that has attributes, behavior, and identity. Objects are members of a class. Attributes and behavior of an object are defined by the class definition. What is the relation between Classes and Objects? They look very much same but are not same. Class is a definiti...

Caching Concepts

Image
Q1. What is the difference between Cache object and Application object? The main difference between the Cache and Application objects is that the Cache object provides cache-specific features, such as dependencies and expiration policies. Q2. How to get access to Cache object ? The Cache object is defined in the System.Web.Caching namespace. You can get a reference to the Cache object by using the Cache property of the HttpContext class in the System.Web namespace or by using the Cache property of the Page object. Q3. What are dependencies in cache and types of dependencies? When you add an item to the cache, you can define dependency relationships that can force that item to be removed from the cache under specific activities of dependencies. Example if the cache object is dependent on file and when the file data changes you want the cache object to be update. Following are the supported dependency : File dependency: Allows you to invalidate a specific cache item when a di...

Remoting and WebService

Remoting and Webservices What is an application domain? Previously “PROCESS” where used as security boundaries. One process has its own virtual memory and does not over lap the other process virtual memory; due to this one process can not crash the other process. So any problem or error in one process does not affect the other process. In .NET they went one step ahead introducing application domains. In application domains multiple applications can run in same process with out influencing each other. If one of the application domains throws error it does not affect the other application domains. To invoke method in a object running in different application domain .NET remoting is used.   What is .NET Remoting? .NET remoting is replacement of DCOM. Using .NET remoting you can make remote object calls which lie in different Application Domains. As the remote objects run in different process client calling the remote object can not call it directly. So the client...

Threading

Threading What is multi-tasking? It is a feature of modern operating systems with which we can run multiple programs at same time   What is multi-threading? Multi-threading forms subset of multi-tasking. Instead of having to switch between programs this feature switches between different parts of the same program. Example you are writing in word and at the same time word is doing a spell check in background.   What is a Thread? A thread is the basic unit to which the operating system allocates processor time.   Did VB6 support multi-threading? While VB6 supports multiple single-threaded apartments, it does not support a freethreading model, which allows multiple threads to run against the same set of data.   Can we have multiple threads in one AppDomain ? One or more threads run in an AppDomain. An AppDomain is a runtime representation of a logical process within a physical process. Each AppDomain is started with a single thread, but can creat...

NET Interoperability

How can we use COM Components in .NET? .NET components communicate with COM using RCW (Runtime Callable Wrapper). Following are the ways with which you can generate RCW : Adding reference in Visual Studio.net. Wrapper class is generated and placed in the "BIN" directory. Using Type library import tool. Tlbimp.exe yourname.dll. Using Interopservices.System.Runtime.InteropServices namespace contains class TypeLib Converter which provides methods to convert COM classes and interface in to assembly metadata. Make your custom wrappers.If your COM component does not have type library then the only way to communicate is writing custom wrappers. That means communicating directly with COM components. ...