Articles : Page 7 of 22

  • MVC pass ViewMasterPage a Model

    MVC pass ViewMasterPage a Model

    Jun 10
    21

    I have some data that I would like to display on every page on an MVC site. So my PartialView needs to go in the ViewMasterPage with data passed to it, but how is it possible to pass and then access a ViewModel or Model in a ViewMasterPage. I found quite a cunning way of doing this by using the ViewMasterPage%lt;T%gt; class instead ofViewMasterPage to model and use the data I need. SolutionI made a new class called BaseViewModel. This will be the class that all ViewModels should now inherit f...

    • MVC2

  • Speaking about ASP.NET MVC Extensibility at the Umbraco CodeGarden10

    Speaking about ASP.NET MVC Extensibility at the Umbraco CodeGarden10

    Jun 10
    16

    Next week I’ll be speaking about ASP.NET MVC Extensibility at the MVC pre-conference during annual Umbraco CodeGarden conference in Copenhagen starting next June 23rd. The presentation will be split in the two parts (just before and just after lunch) and it will cover the most of the main extensibility points of ASP.NET MVC which I covered in my most popular post: 13 ASP.NET MVC extensibility points you have to know. And I will also talk about the new extensibility points introduced in ASP.N...


  • ASP.NET MVC - MvcSiteMapProvider 2.0 is out!

    ASP.NET MVC - MvcSiteMapProvider 2.0 is out!

    Jun 10
    16

    Im very proud to announce the release of the ASP.NET MVC MvcSiteMapProvider 2.0! Im also proud that the name of this product now exceeds the average length of Microsoft product names. In this blog post, I will give you a feel of what you can (and can not) do with this ASP.NET-specific SiteMapProvider. As a warning: if youve used version 1 of this library, you will notice that I have not thought of backwards compatibility. A lot of principles have also changed. For good reasons though: this r...


  • Episode #177: Data Validation w/ MVC2

    Episode #177: Data Validation w/ MVC2

    Jun 10
    15

    Author: Derik Whittaker In this episode we are going to take a look at how we can use the built-in features in MVC v2 to simplify data validation.We will take a look at how we can use data annoations to validate both client side data submission (via javascript) and server side validation. Watch Here View Details Here ...

    • MVC2

  • Make Form Postbacks work with MVC pages inside a WebForm MasterPage

    Make Form Postbacks work with MVC pages inside a WebForm MasterPage

    Jun 10
    14

    I recently wrote about how I nested an MVC site with in a WebForms MasterPage and it how it all worked perfectly ;) However, I avoided the quite inevitable problem of POSTing not working as expected in your WebForm master page, mainly because I hadn't worked out how. Well I have now found a way and have explained it here: Problem 1.You may notice that any inputs above your MVC placeholder will work and any form inputs below your MVC placeholder will not POST. The problem is that traditional AS...

    • MVC2

  • Pro ASP.NET MVC 2 Framework

    Pro ASP.NET MVC 2 Framework

    Jun 10
    11

    This week Apress is sending the second edition of my ASP.NET MVC book to the printers. Hopefully this means you can get your hands on physical copies by the end of this month. The first edition went deep into the details of the MVC Framework, providing both tutorials and reference material. Judging by sales and review [...]...

    • MVC2

  • Use WebForms MasterPage in MVC project

    Use WebForms MasterPage in MVC project

    Jun 10
    08

    Want to avoid having to duplicate your MasterPage design that you made in your ASP.NET WebForms project in you new MVC project? There is a simple way to share your master page across the ASP.NET web forms and MVC projects. Here's how: Make a new "MVC 2 View Master Page" in your /Views/Shared folder and add the content: <%@ Master Language="C#" MasterPageFile="~/MasterPages/Root.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewMasterPage" %> <asp:Content ID="Content1" ContentPlac...

    • MVC2

  • Don't use runAllManagedModulesForAllRequests=

    Don't use runAllManagedModulesForAllRequests="true" when getting your MVC routing to work

    Jun 10
    04

    It seems to be common advice to make your modules section of your web.config say <modules runAllManagedModulesForAllRequests="true">. In fact this is quite a drastic thing to do to solve the routing problem and has global effects that could CAUSE ERRORS. You need a module that goes by the name of UrlRoutingModule-4.0 to be running through IIS. Now, since your MVC URLs are likely to end without .aspx these will not be picked up by IIS and run through the intergrated pipeline and therefore you wi...


  • Dependency Injection in ASP.NET MVC: Final Look

    Dependency Injection in ASP.NET MVC: Final Look

    Jun 10
    02

    Other posts in this series: Controllers Contextual controller injection Filters Action Results Views In this series, we’ve looked on how we can go beyond the normal entry point for dependency injection in ASP.NET MVC (controllers), to achieve some very powerful results by extending DI to filters, action results and views. We also looked at using the modern IoC container feature of nested containers to provide injection of contextual items related to both the controller and the vi...


  • Creating Visual Studio projects that only contain static files

    Creating Visual Studio projects that only contain static files

    May 10
    27

    Have you ever wanted to create a Visual Studio project that only contained static files and didn’t contain any code? While working on ASP.NET MVC we had a need for exactly this type of project. Most of the projects in the ASP.NET MVC solution contain code, such as managed code (C#), unit test libraries (C#), and Script# code for generating our JavaScript code. However, one of the projects, MvcFuturesFiles, contains no code at all. It only contains static files that get copied to the build...