Html.Awkward

Posted by: K. Scott Allen, on 17 Feb 2011 | View original | Bookmarked: 0 time(s)

Ive seen the HTML helpers in ASP.NET MVC drive developers to madness. For example: @Html.ActionLink("Detail", "Detail", "Car", new { id = 5 }) ... produces ... <a href="/Home/Detail?Length=3" id="5">Detail</a> Notice "Length=3" in the query string? That's probably not what you expected. We see this output because we are calling the ActionLink overload where Car is interpreted as route data and the anonymous object we want to use for route data is instead interpreted as the HTML...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: XML | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 505 | Hits: 47

Similar Posts

  • Changing the default HTML Templates to HTML5 in Visual Studio more
  • Tip: Replacing Html.Encode Calls With New Html Encoding Syntax more
  • Easily extracting links from a snippet of html with HtmlAgilityPack more
  • Html.RenderAction and Html.Action more
  • Telerik Extensions for ASP.NET MVC Troubleshooting more
  • Html Encoding Nuggets With ASP.NET MVC 2 more
  • Performance Gains and Enhanced HTML-like Support Brought to WinForms Applications with Q3 2009 Release more
  • Formatting Text in RadControls for WinForms Q3 2009 more
  • ASP.NET MVC2 Preview 2: Areas and Routes more
  • Html Encoding Code Blocks With ASP.NET 4 more

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD