register assembly in application page
-
29-09-2020 - |
Domanda
I have created a custom Button with some extra properties. I want to register it in my Application Page like this
<%@ Register Namespace="Test1.Test2.Helpers" Assembly="Test1.Test2" TagPrefix="test" %>
But it casts an exception and saying something like it cannot find the assembly.
Soluzione
You need to deploy the assembly to GAC and use the fully qualified Name in assembly tag as:
<%@ Register Tagprefix="MyControls"
Namespace="KM.MyControls.MyControl"
Assembly="KM.MyControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<Your token>" %>
Then you can reference your User Control
<MyControls:MyUserControl runat="server"/>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange