If threaded components can reside in apartments, then where do the wealthy threaded components live? Mansions?
A couple of days ago I discovered MagicAjax. MagicAjax simplifies creating Ajax enriched content. So, how do you use MagicAjax?
Click here
to download MagicAjax.
Step 1
Add a reference to the MagicAjax assembly to your project or a copy of it to the bin directory if you are not using an IDE. Also, add the following HTTP module reference to Web.config:
<
system.web
>
<
httpModules
>
<
add
name
=
"
MagicAjax
"
type
=
"
MagicAjax.MagicAjaxModule, MagicAjax
"
/>
httpModules
>
system.web
>
Step 2
Add the following to top of the web form you would like to use MagicAjax on:
<%
@
Register
TagPrefix
="ajax"
Namespace
="MagicAjax.UI.Controls"
Assembly
="MagicAjax"
%>
Step 3
Use the AjaxPanel control as a place holder for content that you would like to enable Ajax on.
<
ajax
:
AjaxPanel
ID
="AjaxPanel1"
runat
="server">
[Content here]
ajax
:
AjaxPanel
>
There you have it. It's as easy as 1, 2, 3.
C++ Templates and .NET Generics are not the same. There are many differences between them, but the biggest thing that sets them apart is that C++ Templates are instantiated at compile-time while Generics are instantiated at run-time.
Since C++ Templates are instantiated at compile-time, a copy of the code for each instance is generated, replacing the type placeholders with the actual data type. It is the equivalent of creating separate methods that handle several data types. In other words, declaring List, List, List, and List will cause the compiler to generate code for each declaration. Even though there are two Lists of integers, the compiler will still generate the code for both Lists. This seems repetitive, but pretty harmless on the surface. However, what if you have two assemblies where List in Assembly1 is dependent on List in Assembly2, but List in Assembly2 is seen as a completely different type then List in Assembly1? This presents a problem as it is like attempting to return a long or another data type other than an integer.
On the other hand, since Generics are instantiated at run-time, generic specializations are created on demand and share the underlying code whenever possible. This resolves the problem present in C++ Templates as mentioned above.