Unrecognized namespace error

Last post 04-21-2008 11:47 PM by bpag. 3 replies.

Sort Posts:

  • Unrecognized namespace error

    04-18-2008, 12:21 PM
    • Member
      115 point Member
    • ureyes84
    • Member since 01-24-2006, 6:06 PM
    • San Antonio, Tx
    • Posts 76

    Hey world,

     I'm trying to parse the output of an asp.net page and I added a "tag" to the html markup so I can quickly find the spot where I need to start.

    The tag looks like this:

    <TEST:THING>
     

    </TEST:THING>
     

    It works fine, but I get the warning mentioned above.

     Is there  a place (maybe the web.config file) where I can add this tag so I don't get this warning ?

     
    THANKS !
     

    --
    Ask and it will be given to you; seek and you will find; knock and the door will be opened to you. Luke 11:9
  • Re: Unrecognized namespace error

    04-19-2008, 12:02 PM
    • Participant
      762 point Participant
    • wisccal
    • Member since 04-18-2008, 2:50 PM
    • Posts 131

    Hi,

    You can use either the Register directive in your aspx file or the controls tag in web.config.

    The problem with both is that you would have to add an empty class/file for it to work. With Register:

     <%@ Register TagPrefix="TEST" Assembly="YourProjectAssembly" %>
    --> add class THING to project

      <%@ Register TagPrefix="TEST"  TagName="THING" src="THING.ascx" %>
    --> add empty ascx file called THING.ascx

    or in web.config, you can use the controls tag. Check out http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx.

    But wouldn't it be easier to add a div or something with id="test"?

    ==========
    Regards,
    Steve
    www.stkomp.com
     

  • Re: Unrecognized namespace error

    04-21-2008, 11:32 AM
    • Member
      115 point Member
    • ureyes84
    • Member since 01-24-2006, 6:06 PM
    • San Antonio, Tx
    • Posts 76

    wisccal:

    You can use either the Register directive in your aspx file or the controls tag in web.config.

    The problem with both is that you would have to add an empty class/file for it to work. With Register:

     <%@ Register TagPrefix="TEST" Assembly="YourProjectAssembly" %>
    --> add class THING to project

      <%@ Register TagPrefix="TEST"  TagName="THING" src="THING.ascx" %>
    --> add empty ascx file called THING.ascx

    or in web.config, you can use the controls tag. Check out http://weblogs.asp.net/scottgu/archive/2006/11/26/tip-trick-how-to-register-user-controls-and-custom-controls-in-web-config.aspx.

     

     

    Thanks for your reply, however this doesn't work:

    First: I would still get a warning saying that <TEST:THING> is missing the required runat attribute.

    Second: Since it is a web control and it is empty it will render no html, which is useless for me since I'm parsing the page output on the Render event and all the processing requires a starting point which is where tag is.

     

    wisccal:
    But wouldn't it be easier to add a div or something with id="test"?
     

     This is a good idea but if I want to have more than one block "enabled":

     
    <div id="test">
    some text here
    </div>

    <div id="test">
    more text over here
    </div>

     I would have repeated Id's, which actually would work but I'd still get warnings.

     

     

    Any thoughts?

    --
    Ask and it will be given to you; seek and you will find; knock and the door will be opened to you. Luke 11:9
  • Re: Unrecognized namespace error

    04-21-2008, 11:47 PM
    Answer
    • Contributor
      3,517 point Contributor
    • bpag
    • Member since 04-07-2006, 12:05 PM
    • Columbus, OH
    • Posts 533

    Why don't you just make the tag <TESTTHIS></TESTTHIS> without the colon that way ASP.Net won't try to interpret it as a server control? It will still render as a tag on the page sent to the browser but browsers should just ignore it.

    If this post answered your question please remember to 'Mark as Answer'!
Page 1 of 1 (4 items)