让我描述一下我拥有的代码,然后我问这个问题。
我有这样的课
public class MyModel
{
public virtual ICollection<SomeObject> fweek { get; set; }
public virtual ICollection<SomeObject> ftxt { get; set; }
public virtual ICollection<SomeObject> fbool { get; set; }
}
然后我为这样的模型创建编辑器:
@model MyModel
@using(Html.BeginForm("SomeAction", "SomeController", FormMethod.GET))
{
@Html.EditorFor(m => m.fweek)
@Html.EditorFor(m => m.ftxt)
@Html.EditorFor(m => m.fbool)
<input type="submit" value="Submit" />
}
如果我提交表单,我会被重定向到类似的 URL:
http://localhost:3517/pl-PL/Places/Search?
fbool%5B0%5D.Value=false&
fweek%5B0%5D.Value=1&
fweek%5B1%5D.Value=2&
ftxt%5B0%5D.Value=23fasf&
ftxt%5B1%5D.Value=assffg&
问题是:是否可以重写此类 URL(尤其是 %5B 和 %5D 序列)以变得更加 SEO/用户友好?假设此示例 URL 可能如下所示:
http://localhost:3517/pl-PL/Places/Search?
fbool.Value=false&
fweek.Value=1&
fweek.Value=2&
ftxt.Value=23fasf&
ftxt.Value=assffg&
感谢您的任何帮助。问候。