Solution: "Element '%' is not a known element. This can occur if there is a compilation error in the

Discussion in 'ASP .Net' started by hirebrian@hotmail.com, Aug 14, 2007.

  1. Guest

    If you run accross the error message:

    "Element '%' is not a known element. This can occur if there is a
    compilation error in the Web site"

    where '%' is the value of the tagName attribute on a web user control
    you have delcared in your web.config file, then you might try
    prefixing your src attribute value with the ~ (tilda) character. As
    you probably know, this character tells ASP.NET to resolve the path
    from the application root.

    So instead of using:

    <add tagPrefix="MyPrefix" tagName="MyName" src="/UserControls/
    MyControl.ascx" />

    use:

    <add tagPrefix="MyPrefix" tagName="MyName" src="~/UserControls/
    MyControl.ascx" />

    A few people have posted about this and hadn't found a solution.

    Anyway, it solved my problem and figured I would post it.

    Thanks,
    BJS
    , Aug 14, 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. Miguel Dias Moura
    Replies:
    4
    Views:
    444
    Hans Kesting
    May 6, 2004
  2. MK
    Replies:
    5
    Views:
    22,437
    deftflux
    Jun 27, 2008
  3. Elmo Watson
    Replies:
    1
    Views:
    365
  4. John Kotuby
    Replies:
    2
    Views:
    6,628
    shijobaby
    Sep 9, 2010
  5. Dave
    Replies:
    0
    Views:
    1,392
Loading...

Share This Page