??????ASP.NET MVC???????BUG??
???????????? ???????[ 2015/7/31 11:38:18 ] ??????????????? ???? ????
???????????????иó????????Query String??????????Action????Index????????????foo=123&bar=456&baz=789???????????????????????????????????????????????Action????Index?ж?????????????????κ?Ч????
?????????ASP.NET MVC???????????????????????????????InputExtensions?????InputHelper?????????????????InputHelper????????????????????????ModelState?л????????????ModelState?в????????????ViewData?л????????????????ModelState?е?????????ViewData???????????????
public static class InputExtensions
{
private static MvcHtmlString InputHelper(HtmlHelper htmlHelper?? InputType inputType?? ModelMetadata metadata?? string name?? object value?? bool useViewData?? bool isChecked?? bool setId?? bool isExplicitValue?? string format?? IDictionary<string?? object> htmlAttributes);
}
private static MvcHtmlString InputHelper(HtmlHelper htmlHelper?? InputType inputType?? ModelMetadata metadata?? string name?? object value?? bool useViewData?? bool isChecked?? bool setId?? bool isExplicitValue?? string format?? IDictionary<string?? object> htmlAttributes)
{
…
switch (inputType)
{
…
default:
{
string str4 = (string) htmlHelper.GetModelStateValue(fullHtmlFieldName?? typeof(string));
tagBuilder.MergeAttribute("value"?? str4 ?? (useViewData ? htmlHelper.EvalString(fullHtmlFieldName?? format) : str2)?? isExplicitValue);
goto Label_016C;
}
}
…
}
?????????rinsen??????????е?????????????????????????????????????Э?????????????????????????ΥMVC????????MVC??????????????????????????????????????Controller?е????Action????????????Action???????????????????????????View???????????????????????????????????View????????Action????????????????????????????Action????????????????????1???Model??????????????????????????????????????????????м?????????????????
??????????????????????????????
??????Update???????
?????????Model????????Property??????Int????????????Form??????????????????????????ModelState.IsValid??false??????????????View??????????????????????????????Form?С?
?????????model??????е?????????null????Property????????????0)???????????????????0???????????????
?????????????????ModelState??????????????
????[?????????????0???????????“?????????????????”??]
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11