+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / object reference error on tags that are not found

object reference error on tags that are not found

6 posts, 0 answered
  1. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    16 Mar 2009
    Link to this post
    whenever I attempt to access a tag that doesn't exist, I am getting the error "Object reference not set to an instance of an object." Is there any way that we can change this so that we can handle this situation gracefully and redirect to a not-found page?

    example link: http://www.mcallenlibrary.net/events/details.aspx?tag=computerclasses

    should be http://www.mcallenlibrary.net/events/details.aspx?tag=computer%20classes

    but clicking the first link just gives me the object reference error. I tried handling the error on the page load on the control that has the eventsview but it appears the error is thrown prior to even the page init.
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    19 Mar 2009
    Link to this post
    Hello SelArom,

    We have reproduced the error, but we are a little bit confused, if you see wrong tags anywhere in the application, or you just try to modify the query string manually.

    Anyway, we have logged this in our system, hopefully we will fix it for the upcoming service pack.

    Best wishes,
    Georgi
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    19 Mar 2009
    Link to this post
    i honestly have no idea where users are finding this link, because in no place do I set it myself. the only thing I can think of is that users are copying and pasting the link and sending it to others incorrectly...

    still, a tag not found should allow for us to handle the situation instead of just throwing an error, so I'm glad you've logged the error and i hope it is addressed soon, thank you!
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    23 Mar 2009
    Link to this post
    Hello SelArom,

    Which control do you use on that page - NewsView/PostsView/EventsView? I might be able to override it in order to catch the exception. Please let me know, so I can try with the right control.

    Sincerely yours,
    Georgi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  5. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    24 Mar 2009
    Link to this post
    I'm using the NewsView control, mapped to my external template in which I'm adding code-behind. I tried to catch the error on page load and preinit but the error is still thrown before it reaches my code to catch an invalid tag and redirect...

    let me know what other information I can provide, thanks!
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 Mar 2009
    Link to this post
    Hello,

    We confirm that this has been fixed for the upcoming service pack.

    The workaround though, is to override the CreateChildControls method of the ContentView class. You can surround the base.CreateChildControls method with try-catch statement, and try to catch the NullReferenceException.

    Let me know if you have any other questions.

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Register for webinar
6 posts, 0 answered