1

私はそのようなURLを持っています:/%20Account/%20LogOn?ReturnUrl=%2f+Admin%2f+Index

2 つの質問があります。

1) なぜ私は%20前にAccountとを持っているのLogOnですか? スペースのようなものですか?

%202)前Accountとを削除する方法はLogOn?

多分ルートに何か問題がありますか?

それは私のクラスRegisterRoutesです:

public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");


        routes.MapRoute(
            null, 
            "", 
            new { controller = "Product", action = "List",category = (string)null,page=1 }) ;

        routes.MapRoute(null,
            "Page{page}", 
            new { controller = "Product", action = "List",category = (string)null });

        routes.MapRoute(
            null,
            "{category}",
            new { controller = "Product", action = "List", page = 1 });

        routes.MapRoute(
           null,
           "{category}/Page{page}",
           new { controller = "Product", action = "List"});

        routes.MapRoute(null, " {controller}/ {action}");

    }
4

4 に答える 4

1

あなたの URL には単語間に空白が含まれているため、

たとえば、ブラウザにこの (' somesite.com/something ') アドレスを入力すると、ブラウザはそのアドレスを'somesite.com/some%20thing'にエンコードします。

次にURL、コードビハインドでデコードするには、使用できますServer.UrlDecode("someURL")

于 2013-10-29T17:03:14.370 に答える
0

1) それはエンコードされURLた .

2)どのコンテキストで使用しているかはわかりませんが、次を使用してデコードできますServer.UrlDecode("string")

于 2013-10-29T17:04:27.670 に答える