Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kieron 152 posts 390 karma points
    Mar 14, 2019 @ 12:08
    Kieron
    0

    Load result if theres only 1

    Is this possible? Thought it'd be pretty cool if there's only 1 result to just load it straight up.

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Mar 14, 2019 @ 13:08
    Nik
    0

    Yes this would be possible... but you'd do it with a non-cached redirect of some sort I suspect.

    So you'd do the search, find out if there is a result. If there is, return the redirect to the page with the no-cache header to stop browser caching.

  • Kieron 152 posts 390 karma points
    Mar 14, 2019 @ 13:24
    Kieron
    0

    Ok cool!

    I've got this so far which works, and I just jammed this into the macro partial;

     if (results.Count == 8)
            {
                Response.Redirect("https://www.google.com");
            }
    

    that much works, but need to look into the non-cached redirect as I'm not sure what that is.

  • Kieron 152 posts 390 karma points
    Mar 14, 2019 @ 13:50
    Kieron
    0

    So I just tried the route of copying an existing helper & just redirecting it to this helper if there's only 1 result, then pushing you onto the result.Url, but couldn't get anything, I'm not going to keep trying as it was only a small ask. :)

Please Sign in or register to post replies

Write your reply to:

Draft