Problem to use a VB.NET Custom Control in the same assembly
-
Hello, I try to implement a custom control in VB.NET and instanciate this in a Page in the same project. I don't get any errors but I don't see my control. All examples that I can find have the custom control in a separate assembly with a separate project and mostly the custom control is programmed in C#. Is there a possibility for use the custom control in the same project and the same assembly? Please help me and note, that I'm not a C#-Programmer. Here comes more informations: - the cc-source is in MyCC.vb in Testproject - the cc-class is named MyOwnControl - I register the cc with
<%@ Register TagPrefix="MYCC" NameSpace="Testproject" Assembly="Testproject" %>
in a page in Testproject too. - I instanciate the cc with<MYCC:MyOwnControl id="moc" visible="true"></MYCC:MyOwnControl>
Best regards Stephan -
Hello, I try to implement a custom control in VB.NET and instanciate this in a Page in the same project. I don't get any errors but I don't see my control. All examples that I can find have the custom control in a separate assembly with a separate project and mostly the custom control is programmed in C#. Is there a possibility for use the custom control in the same project and the same assembly? Please help me and note, that I'm not a C#-Programmer. Here comes more informations: - the cc-source is in MyCC.vb in Testproject - the cc-class is named MyOwnControl - I register the cc with
<%@ Register TagPrefix="MYCC" NameSpace="Testproject" Assembly="Testproject" %>
in a page in Testproject too. - I instanciate the cc with<MYCC:MyOwnControl id="moc" visible="true"></MYCC:MyOwnControl>
Best regards Stephan -
Hello, I try to implement a custom control in VB.NET and instanciate this in a Page in the same project. I don't get any errors but I don't see my control. All examples that I can find have the custom control in a separate assembly with a separate project and mostly the custom control is programmed in C#. Is there a possibility for use the custom control in the same project and the same assembly? Please help me and note, that I'm not a C#-Programmer. Here comes more informations: - the cc-source is in MyCC.vb in Testproject - the cc-class is named MyOwnControl - I register the cc with
<%@ Register TagPrefix="MYCC" NameSpace="Testproject" Assembly="Testproject" %>
in a page in Testproject too. - I instanciate the cc with<MYCC:MyOwnControl id="moc" visible="true"></MYCC:MyOwnControl>
Best regards StephanHi there, You need to add the
runat="server"
to the declaration of your custom control, it should look like this:<MYCC:MyOwnControl runat="server" id="moc" visible="true"></MYCC:MyOwnControl>
If you don't add it to the control declaration on the web page, you might see that markup when you do a view source the web page.