DmitryEfimenko / TwitterBootstrapMvc

Fluent implementation of ASP.NET-MVC HTML helpers for Twitter Bootstrap.
Apache License 2.0
224 stars 79 forks source link

RouteValues on form object reference not set #125

Closed chrisjainsley closed 10 years ago

chrisjainsley commented 10 years ago

When I try to use routevalues on a form I get object reference not set.

@Using Form = Html.Bootstrap.Begin(New Form("Order", "OrderManagement").Type(FormType.Horizontal).RouteValues(New With { .id = order.Order_Id}).FormMethod(FormMethod.Post))
End Using

.

at TwitterBootstrapMVC.TypeExtensions.TypeExtensions.MergeHtmlAttributes(IDictionary2 source, IDictionary2 htmlAttributes) at TwitterBootstrapMVC.Form.RouteValues(Object routeValues) at ASP._Page_Views_OrderManagement_Orders_vbhtml.Execute() in C:\Projects\Bentley\BentleyOPSManagement\BentleyOPSManagement\Views\OrderManagement\Orders.vbhtml:line 23 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.<>cDisplayClass1a.b17() at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation)

Any ideas?

DmitryEfimenko commented 10 years ago

I just tested this. Seems to work for me. Try to replace order.Order_Id with something like "3" to make sure there is no issue with that. Also, make sure you have latest BMVC. I think some time ago there was an issue related to this that was fixed. As of now latest version is 3.5.2 Let me know if you still have issue after that.

DmitryEfimenko commented 10 years ago

Any feedback on this?

chrisjainsley commented 10 years ago

Haven't had chance to get back to the project, should have time on Monday.

DmitryEfimenko commented 10 years ago

I assume this was fixed. Closing issue