locked
Custom Template Control Referencing RRS feed

  • Question

  • User-1254308814 posted

    I setup a custom control that I want to reference from a custom insert  page (CustomPages/Project/Insert.aspx for example). When I try to reference the custom control which is ~/DynamicPages/Controls/mycontrol.ascx the reference isn't resolved and there is a not found exception. Is there a different way I should be going about implementing this sort of custom control functionality.

     

    Wednesday, October 22, 2008 5:55 PM

All replies

  • User1024101778 posted

     How are you referencing the control?  Is it static or dynamic? Can you provide some code examples?

    Wednesday, October 22, 2008 7:37 PM
  • User-1254308814 posted

    Page ...DynamicData/CustomPages/Project/Insert.aspx
    Control .... DynamicData/Controls/MyControl.ascx

    <%@ Page <for custom project Insert.aspx.... %>
    <%@ Rererence Src="~/DynamicData/Controls/MyControl.ascx" TagPrefix="bosi" TabName="Editor" %>

    <bosi:Editor id="editor1" runat="server" />

     Note that I typed this out by hand. Be sure that there are no incorrect paths in my code. DynamicData/Controls/MyControl.ascx also didn't work. I didn't try ../../Controls.

    Wednesday, October 22, 2008 9:24 PM
  • User-1005219520 posted

    It shouldn't be any different from the way the page templates refrence the GridViewPager and the FilterUserControl. Look at any of the page templates

    <%@ Register src="~/DynamicData/Content/GridViewPager.ascx" tagname="GridViewPager" tagprefix="asp" %>
    <%@ Register src="~/DynamicData/Content/FilterUserControl.ascx" tagname="DynamicFilter" tagprefix="asp" %>
    

     I've added controls to ~/DynamicData/Content/ and refrenced them in the page templates.

    Wednesday, October 22, 2008 10:20 PM
  • User1024101778 posted

    Jamie,

    If I had to guess, I would think the UriRouting may be causing you an issue while trying to reference the ~/DynamicData/Controls/ directory.   Is there any reason you can't move your Controls directory to ~/DynamicData/Content/Controls?

    Thursday, October 23, 2008 9:02 AM