I have an old version of the asp.net component . I would like to use a newer version along with the old version.
I installed both assemblies in the GAC using the command gacutil.exe. Now I would like to download a specific version of the component on each page .aspx.
gacutil.exe
.aspx
How can i do this?
Can i use this code?
<%@ Register assembly="<dllname>, Version=2.5.0.0, Culture=neutral, PublicKeyToken=......." Namespace="<dllNamespace>." TagPrefix="WG" %>
You can use create the version object you want at runtime using the following code
Object obj = Activator.CreateInstance("dllName","dllNameSpace.ClassName");
Activator.CreateInstance Activator.CreateInstance
, , Register, . , .
Register
, , usercontrols, . , : controls_for_1_5 controls_for_2_5, . (, , ). - , Can't cast 'Namespace.ClassA' to 'Namespace.ClassA' (, , ), .
controls_for_1_5
controls_for_2_5
Can't cast 'Namespace.ClassA' to 'Namespace.ClassA'
, , , .NET.