Category Archives: Razor

Accessing Embedded Resources from Razor Views in ASP.Net MVC

In razor, there is no access to the ClientScriptManager so there is no readily available method of using that class’s useful GetWebResourceUrl method to retrieve embedded resources. There are few techniques for synthesizing the functionality, revolving around the reflection of … Continue reading

Posted in Razor | Tagged , | 1 Comment

Localization of Dates in ASP.Net MVC

Introduction It is a somewhat inconvenient truth that users of your web site are everywhere but they don’t all talk the same language or even do simple things like read dates in the same way. ASP.Net prov ides rich support … Continue reading

Posted in ASP.Net MVC, jQuery, Razor | Tagged , , , | 1 Comment

Using EditorTemplates in MVC 3

How many time in web development do you find yourself writing the same three elements for every input field – the label, the input field itself and the validation element(s). For example, @Html.LabelFor(x=>x.Firstname) @Html.TextBoxFor(x=>x.Firstname) @Html.ValidationMessageFor(x=>x.Firstname) This is better than … Continue reading

Posted in ASP.Net MVC, Razor | Tagged , | 3 Comments