Articles : Page 1 of 1
-
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: ...
-
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...
-
MVC 2 Model Metadata to Render Dynamic UI
Sep 1009Recently we had a project where we needed to render certain questions on the screen dynamically based on answers to previous questions on previous screens. For questions that need to dynamically be visible/invisible on the same screen, this can simply be controlled with jQuery. However, in this case, based on the user’s input on previous screens we know there are certain questions that will not be applicable before the current screen even loads. In this case, we could use jQuery to set those...
-
What is the difference in <%: variable%> and <%= variable%> in ASP.NET MVC?
Aug 1023With many folks adopting ASP.NET MVC as well as Visual Studio 2010, there is a fairly confusing change if you are one of those people who doesn’t engage in the alpha and beta phases of new product releases from Microsoft or any other vendor, for that matter. The issue of <%: vs. <%= has had a great deal of discussion around it in the years leading up to the Visual Studio 2010 release. This new expression syntax, or code nugget, is a new feature of ASP.NET 4. It applies equally to ASP.NET Web...
- 1

