I'm trying to do the relatively simple task of registering a server control, and I'm having a few problems that I hope you guys can help me with!
I'm using this guide:
To build and use the control that's provided for me.
I've followed the guide to the letter, but Visual Studio isn't recognising the new control.
The guide-writer doesn't tell you where to put the web control class, so I put it in a random directory and referenced the namespace and assembly as the guide tells me to.
I've also tried compiling the control into a DLL and referencing it in Visual studio. This also fails.
Is the guide missing something elementary that I am perhaps expected to know that's involved in registering and using a server control?
Thanks for any help,
Compiling the code into a DLL and then place it in the /bin folder of your EPiServer installation should do the trick.
Thanks very much for such a prompt response, it's very much appreciated!
Unfortunately, that's exactly where I put my newly compiled DLL, but my control is still not recognised.
I've added it to my visual studio references, and I'm referencing it directly within the page with the following line:
<%@ Register TagPrefix="yucca" TagName="PageList" Namespace="Antecknat.Web.WebControls" Assembly="Antecknat" %>
I'm then referencing the control with:
<yucca:PageList ID="PageList1" runat="server> </yucca:PageList>
This is still not working. :(
Do you have any further thoughts?
Hi, leave the TagName out when registering:
<%@ Register TagPrefix="yucca" Namespace="Antecknat.Web.WebControls" Assembly="Antecknat" %>
And, is the resulting assembly named "Antecknat.dll"?Also make sure that the class PageList really exists in the namespace Antecknat,Web.WebControls.
If all above is correct, it *should* work.
The DLL being produced was something else, so I changed the assembly tag to what it was producing, dropped the TagName property, and hallelujah, it works!
Thanks very much Johan, you are officially ace! :D