tagMapping doesn't work with HtmlForm

Discussion in 'ASP .Net Web Controls' started by Bruno, Jan 7, 2007.

  1. Bruno

    Bruno Guest

    Hello guys,
    I'm having problem using tagMapping with HtmlForm, I have this in
    web.config:

    <tagMapping>
    <add tagType="System.Web.UI.HtmlControls.HtmlForm"
    mappedTagType="CustomForm" />
    </tagMapping>

    It just doesn't work... it compiles ok, but the HtmlForm is not mapped to
    CustomForm, it works very well with other controls, but doesn't work with
    HtmlForm.

    If I go to the page, and add this:
    <%@ Register Assembly="System.Web, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.HtmlControls"
    TagPrefix="SW" %>

    And change the <form> tag to:
    <SW:HtmlForm id="form1" runat="server">
    </SW:HtmlForm>

    Then the tagMapping works!!

    The problem with doing this is that the designer shows an error:
    form1:Unable to cast object of type
    'System.Web.UI.Design.HtmlIntrinsicControlDesigner' to type
    'System.Web.UI.Design.ControlDesigner'.

    and the source mode shows:
    Element 'HtmlForm' is not a known element. This can occur if there is a
    compilation error in the Web site.


    I'm creating a custom form and it needs to have an easy implementation to
    the team, without the need to go and change every page in the system.

    I took a look at the temp .vb files generated and it really instantiate the
    form object as HtmlForm.

    Anyone knows how to solve this?

    Thanks in advance!
    Bruno
    Bruno, Jan 7, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Dockman
    Replies:
    0
    Views:
    437
    Jeff Dockman
    Nov 17, 2003
  2. Jiho Han
    Replies:
    2
    Views:
    1,910
    Jiho Han
    Feb 11, 2004
  3. VB Programmer
    Replies:
    0
    Views:
    378
    VB Programmer
    Mar 4, 2004
  4. VB Programmer
    Replies:
    0
    Views:
    400
    VB Programmer
    Mar 5, 2004
  5. Bruno
    Replies:
    0
    Views:
    597
    Bruno
    Jan 7, 2007
Loading...

Share This Page