Articles : Page 1 of 2
-
Adding Export Capabilities to the Razor WebGrid
Sep 1103When MVC first came out I really missed having a grid control. Now a few years later, we finally have a grid control again. In case, you didnt know the WebGrid was included in the System.Web.Helpers assembly which shipped with MVC 3. After using a variety of grid controls over the years I was actually glad that the API for the new WebGrid was kept clean and simple. Here is a screenshot of what the grid looks like: To display a grid on a razor view page, you basically create a new grid objec...
-
Studio for Wijmo MVC Review
Aug 1122I was recently asked to review Studio for Wijmo MVC by Component One and, overall, I am impressed. There are 2 major components of this. The first is Wijmo Complete which is a collection of over 30 UI widgets (very similar to jQuery UI). The second is Wijmo Scaffolding for MVC which builds upon the scaffolding that was released as part of the MVC 3 Tools Update (note: is does *not* build on top of powershell-based MVC Scaffolding which Microsoft released earlier this year). Some of the Wijmo...
-
How to access controller methods from a view in ASP.NET MVC
Jul 1130This question has been posed in several places. One of the places is on StackOverflow here. The use case here is that my controller has important state or an important function, and I’d like to leverage it from the view. It’s not appropriate to factor out to an html helper or other view-based utility class. It is something unique to the controller. It would be very easy to just pass the controller over to the view so that the view could make use of its methods, but there is a lot of discussion...
-
ViewData, ViewModel, ViewBag...
Jul 1125I was reading Rachel Appel’s post today on when to use ViewData, ViewBag, and TempData and I think it’s a good read. I left a comment but it disappeared… I think her comments might be borked… so I’ll add it here as I think it’s valuable. Here’s the comment I left: ———————————————————————————- Hi Rachel - nice post :). I think there’s a lot of confusion about this and it’s nice to see you tackle it :). If I may - it might be worth pointing out that *everything* (aside from TempData) ge...
-
A first look at Windows Azure AppFabric Applications
Jul 1107After the Windows Azure AppFabric team announced the availability of Windows Azure AppFabric Applications (preview), I signed up for early access immediately and got in. After installing the tools and creating a namespace through the portal, I decided to give it a try to see what it’s all about. Note that Neil Mackenzie also has an extensive post on “WAAFapps” which I recommend you to read as well. So what is this Windows Azure AppFabric Applications thing? Before answering that question, le...
-
Changing Base Type Of A Razor View
Feb 1121Within a Razor view, you have access to a base set of properties (such as Html, Url, Ajax, etc.) each of which provides methods you can use within the view. For example, in the following view, we use the Html property to access the TextBox method. @Html.TextBox("SomeProperty") Html is a property of type HtmlHelper and there are a large number of useful extension methods that hang off this type, such as TextBox. But where did the Html property come from? It’s a property of System.We...
-
MVC 3 AdditionalMetadata Attribute with ViewBag to Render Dynamic UI
Jan 1131A few months ago I blogged about using Model metadata to render a dynamic UI in MVC 2. The scenario in the post was that we might have a view model where the questions are conditionally displayed and therefore a dynamic UI is needed. To recap the previous post, the solution was to use a custom attribute called [QuestionId] in conjunction with an “ApplicableQuestions” collection to identify whether each question should be displayed. This allowed me to have a view model that looked like this: ...
-
Mixing Razor Views and WebForms Master Pages with ASP.NET MVC 3
Jan 1125I've spent the last few weeks travelling around presenting WebMatrix, Razor and ASP.NET MVC 3 to folks. Many people have existing WebForms apps or MVC apps with WebForms Views. The question has come up a number of times, Can I mix Razor Views and WebForms Views in a single ASP.NET MVC application? The answer is, No, Yes, and Maybe, But It's Not Supported. Most commonly the scenario is that someone has an existing WebForms (ASPX) Master Page that works nicely, and they now want to include...
-
An easy approach to adding user notifications to ASP web applications
Dec 1007We all have to do it inform the user of some status such as whether their edit saved properly and/or if a form submission was successful. The work here is based on something I picked up on the this blog: http://blog.idleworx.com/2010/11/friendly-css-error-messages-for-java.html. I changed things slightly to take advantage of the .NET environment. Have you ever wanted user notifications that faded out over a certain time interval? Perhaps you want the user to be able to click a message to m...
-
Integrate Html5 Form in ASP.NET MVC
Oct 1020This article is divided into three parts. In the first, part I will show you how you can add Html5 forms in your ASP.NET MVC application with very minimum effort. In the second part, I will show you how to implement client side validation which will trigger automatically even when the browser does not have the html5 client side validation support and in the last part I will show widgetify the form in the client side with jQuery for the older browser that does not have support for Html5 form. ...
- 1
- 2

