Monday, April 26, 2010
Working with Javascript on Serverside
Ref2: http://dotnetslackers.com/articles/aspnet/JavaScript_with_ASP_NET_2_0_Pages_Part1.aspx
Saturday, April 24, 2010
Gridview in Edit Mode with and with out datasource
Ref2 : through ObjectDataSource which can be set from a business Layer.
http://msdn.microsoft.com/en-us/library/ms178538.aspx
Ref3: Code Data-Bound GridView & FindControl
http://wiki.asp.net/page.aspx/476/code-data-bound-gridview-amp-findcontrol/
Ref4: http://amitpatriwala.wordpress.com/2008/04/18/inserting-new-row-in-gridview-in-aspnet-20/
Thursday, April 15, 2010
Monday, April 12, 2010
Thursday, April 8, 2010
Inversion of Control (IoC) pattern or Dependancy Injection (DI)
Def of DI: Instead creating an new object every time we call the container which will create the object of that class for us.
Injection or Imposing a Dependacy (called an object b or can be a Property, method also) on the De pendant class A through a container or IoC Framework is called DI.
Ref: http://www.dotnetspark.com/kb/266-inversion-control-ioc-and-dependency-injection.aspx
Wednesday, April 7, 2010
Enterprise Library 3.0
Ref:http://www.codeproject.com/KB/aspnet/Questpond.aspx
Hosting in IIS 7
1. Add user called IIS_IUSRS or go to application pool -> advanced settings -> In Process model we have Identity change it local system.
2. change authentication to None in web.config file.
Hosting a WCF Application
1. Click the Start button, and then click Control Panel.
2. Click Programs, and then click Programs and Features.
3. On the Tasks menu, click Turn Windows features on or off.
4. Find the .NET Framework 3.5 node, select and then expand it.
5. Select the WCF Http Activation Components box and save the setting.
6.change authentication to None in web.config file.
Tuesday, April 6, 2010
Code Access Security (CAS)
Boxing and Unboxing
Below is sample code of boxing and unboxing where integer data type are converted in to object
and then vice versa.
int i = 1;
object obj = i; // boxing
int j = (int) obj; // unboxing
Value types directly contain their data that are either allocated on the stack or allocated in-line in a structure. So value types are actual data.
Reference types store a reference to the value's memory address, and are allocated on the heap. Reference types can be self-describing types, pointer types, or interface types. You can view reference type as pointers to actual data.
Variables that are value types each have their own copy of the data, and therefore operations on one variable do not affect other variables. Variables that are reference types can refer to the same object; therefore, operations on one variable can affect the same object referred to by another variable. All types derive from the System. Object base type.
Garbage collection in .Net
to release the objects while coding ... Laziness (Remember in VB6 where one of the good
practices is to set object to nothing). CLR automatically releases objects when they are no longer
in use and refernced. CLR runs on non-deterministic to see the unused objects and cleans them.
One side effect of this non-deterministic feature is that we cannot assume an object is destroyed
when it goes out of the scope of a function. We should avoid using destructors because before GC
destroys the object it first executes destructor in that case it will have to wait for code to release
the unmanaged resource. This results in additional delays in GC. So it is recommended to
implement IDisposable interface, write cleanup code in Dispose method, and call
GC.SuppressFinalize method. Its like instructing GC not to call your constructor.
Difference between a namespace and assembly
Namespace: It is a Collection of names wherein each name is Unique.
They form the logical boundary for a Group of classes.
Namespace must be specified in Project-Properties.
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
1) It is an Output Unit.
2)It is a unit of Deployment & a unit of versioning.
3)Assemblies contain MSIL code.
4)Assemblies are Self-Describing. [e.g. metadata,manifest]
5)An assembly is the primary building block of a .NET Framework application.
6)It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files).
7)All managed types and resources are marked either as accessible only within their implementation unit, or by code outside that unit.
IIS and the Process Model
The IIS 5.0 Process Model
The IIS 6.0 Process Model