Lỗi: 'HtmlHelper<dynamic>' has no applicable method named 'Hidden' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax Mã: @Html.Hidden("IdCategoryList", ViewBag.VBCate.ToString(), new { @id = "IdCategoryList" }) Mình có chuyển nó qua .ToString() rùi mà sao nó vẫn không hiểu nhỉ, giờ làm sao để add giá trị mặc định đây giúp mình với. Cảm ơn
Của bạn đây: HTML: @Html.Hidden("IdCategoryList", (string)ViewBag.VBCate.ToString(), new { @id = "IdCategoryList" }) Thêm (string) trước ViewBag nữa bạn nhé.