开发者

Register custom class in assembly with web project

I'm using web project and web forms.

I create Custom Class

 Namespace CustomWebControls
  Public Class NoValidationDDL
    Inhe开发者_如何学Crits DropDownList


  End Class
End Namespace

and i try to register this class in assembly web.config page section

<controls>
        <add tagPrefix="customDDL" namespace="CustomWebControls" assembly="ae" />
</controls>

and try to use in ascx

<customDDL:NoValidationDDL ID ="id" runat="server"></customDDL:NoValidationDDL>

How can i do this in web project?


This should work (assuming the assembly name for your project is ae) - make sure that you build the project after creating/modifying your custom control. Unless updated 'ae.dll' is present in your bin directory, intellisense etc will not work.

Instead of modify web.config, you may also try register control at page(aspx) or control(ascx) level by adding register directive after page directive:

<%@ Register Assembly="ae" Namespace="CustomWebControls" TagPrefix="customDDL" %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜