Html Encoding Code Blocks With ASP.NET 4

Posted by: youve been HAACKED, on 25 Sep 2009 | View original | Bookmarked: 0 time(s)

One great new feature being introduced in ASP.NET 4 is a new code block (often called a Code Nugget by members of the Visual Web Developer team) syntax which provides a convenient means to HTML encode output in an ASPX page or view. <%: CodeExpression %> I often tell people its <%= but with the = seen from the front. Lets look at an example of how this might be used in an ASP.NET MVC view. Suppose you have a form which allows the user to submit their first and last name....

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: ASP.NET | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 1728 | Hits: 106

Similar Posts

  • Tip: Replacing Html.Encode Calls With New Html Encoding Syntax more
  • Html Encoding Nuggets With ASP.NET MVC 2 more
  • VS10 Beta 2 From an ASP.NET MVC Perspective more
  • ASP.NET MVC 2 Preview 2 more
  • Tip/Trick: Increase your VS screen real estate by disabling HTML Navigation Bar more
  • WebAii Testing Framework: From HTML to XAML and Back -- RadHtmlPlaceholder more
  • How to create a DropDownList with ASP.NET MVC more
  • Reporting Release History : Q2 2009 SP1 (version 3.1.9.807) more
  • Silverlight Twitter Client with authentication more
  • How To: Easy printing with Telerik RadGridView for Silverlight 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