在 Global.asax 中爲 string 類型指定這個 ModelBinder
protected void Application_Start()
{
ModelBinders.Binders.Add(typeof(string), new StringTrimModelBinder());
//...
}
protected void Application_Start()
{
ModelBinders.Binders.Add(typeof(string), new StringTrimModelBinder());
//...
}
問題:當前不會命中斷點。還沒有爲該文檔加載任何符號。 解決方案: 打開項目下****.csproj 文件,修改 DebugType節點 ,默認是none,修改成 full 即可。