简体   繁体   中英

What do I have to do to get EWL Shortcut URLs to work?

I have this code:

protected override IEnumerable<ShortcutUrlResolver> GetShortcutUrlResolvers() {
    return new[]
        {
            new ShortcutUrlResolver( "someShortcut", ConnectionSecurity.SecureIfPossible, () => SmartRedirector.GetInfo( Pages.One.Two.GetInfo().GetUrl() ) ),
            new ShortcutUrlResolver( "", ConnectionSecurity.SecureIfPossible, () => Pages.Portals.GetInfo() )
        };
}

If I go to mysite/ , I end up at the Portals page (the second shortcut above) . If I go to mysite/someShortcut, I get a error:

this page is no longer available .

The problem was I wasn't trying to navigate to "mysite/someShortcut", I was trying to navigate to "mysite/someShortcut/", with a trailing slash. The slash counts. So, removing the slash from my URL makes it work. Also, I can include both "someShortcut/" and "someShortcut" as shortcut URLs and then either one will work.

您似乎已经正确定义了快捷方式URL,并且我不认为访问快捷方式URL时会出现“您请求的页面不再可用”错误,因此问题似乎出在您的重定向上遵循快捷方式URL后,您可以自行完成操作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM