asp.net-mvc

Asp.Net Routing: How do I ignore multiple wildcard routes?

I'd like to ignore multiple wildcard routes. With asp.net mvc preview 4, they ship with: RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); I'd also like to add something like: RouteTable.Routes.IgnoreRoute("Content/{*pathInfo}"); but that seems to break some of the helpers that generate urls in my program. Thoughts? ...

Asp.Net MVC: How do I enable dashes in my urls?

I'd like to have dashes separate words in my URLs. So instead of: /MyController/MyAction I'd like: /My-Controller/My-Action Is this possible? ...

How do I configure an ASP.NET MVC project to work with Boo

I want to build an ASP.NET MVC application with Boo instead of C#. If you know the steps to configure this type of project setup, I'd be interested to know what I need to do. The MVC project setup is no problem. What I'm trying to figure out how to configure the pages and project to switch to use the Boo language and compiler. Chris ...

Where can I find a good ASP.NET MVC sample?

I have been using Castle MonoRail for the last two years, but in a new job I am going to be the one to bring in ASP.NET MVC with me. I understand the basics of views, actions and the like. I just need a good sample for someone with MVC experience. Any good links besides Scott's Northwind traders sample? ...

Assert action redirected to correct action/route?

How do I exercise an action to ensure it redirects to the correct action or route? ...

Mocking Asp.net-mvc Controller Context

So the controller context depends on some asp.net internals. What are some ways to cleanly mock these up for unit tests? Seems like its very easy to clog up tests with tons of setup when I only need, for example, Request.HttpMethod to return "GET". I've seen some examples/helpers out on the nets, but some are dated. Figured this would b...

Beginning ASP.NET MVC with VB.net 2008

Where can I find a good tutorial on learning ASP.NET MVC using VB.net 2008 as the language? Most in-depth tutorials that I found in searching the web were written in C#. ...

Where can I get ASP MVC hosting?

I really need some ASP MVC CTP 4 hosting. Is anyone doing this? I can't believe there is no-one willing to take my money just because it's in beta. This is a customer requirement, so why is each host I ask just saying 'we can't do that'? ...

Best way to implement request throttling in ASP.NET MVC?

We're experimenting with various ways to throttle user actions in a given time period: Limit question/answer posts Limit edits Limit feed retrievals For the time being, we're using the Cache to simply insert a record of user activity - if that record exists if/when the user does the same activity, we throttle. Using the Cache automa...

ASP.NET MVC on IIS6

Where can I find some good pointers on best practices for running ASP.NET MVC on IIS6? I haven't seen any realistic options for web-hosts who provide IIS7-hosting yet. Mostly because I don't live in the U.S. So I was wondering on how you best build applications in ASP.NET MVC and make it easily available to deploy on both IIS6 and IIS7...

How do you use the new ModelBinder classes in ASP.NET MVC Preview 5

You'll notice that Preview 5 includes the following in their release notes: Added support for custom model binders. Custom binders allow you to define complex types as parameters to an action method. To use this feature, mark the complex type or the parameter declaration with [ModelBinder(…)]. So how do you go about actually using ...

Bypass Forms Authentication auto redirect to login, How to?

I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually when a user tries to access a resource without proper authorization I want them to be redirected to a login page. FormsAuth does this for me easy enough. Problem: Now I have an action being accessed by a console app. Whats the quickest way to...

What is the replacement of Controller.ReadFromRequest in ASP.NET MVC?

I am attempting to update a project from ASP.NET MVC Preview 3 to Preview 5 and it seems that Controller.ReadFromRequest(string key) has been removed from the Controller class. Does anyone know of any alternatives to retrieving information based on an identifier from a form? ...

ASP.NET MVC: Structuring Controllers

So I'm embarking on an ASP.NET MVC project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the same issue wherein controller methods violate SRP (single responsibility prin...

ASP.NET MVC - How do action names affect the url?

Using MVC out of the box I found the generated URLs can be misleading and I wanted to know if this can be fixed or if my approach/understanding is wrong. Suppose I have a CreateEgg page, which has a form on it, and once the form is filled in and submitted the user is taken to a ListEggs page with the new egg in it. So my egg controller...

ASP.NET MVC vs. XSL

Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of data on a web-page with XSL over ASP.NET MVC? The two alternatives are: ASP.NET (MVC/WebForms) with XSL Getting the data from the database and transforming it to XML which is then displayed on the different pages with XSL-templates. ASP.NET MVC Ge...

Have you got a CascadingDropDown working with ASP.NET MVC?

If so how? Did you roll your own with jQuery or use the Microsoft AJAX toolkit? Did you create a webservice or call an action? EDIT : Please note that this question was asked before Microsoft announced that they were going to bundle jQuery in with VS/ASP.NET MVC. I think there is less of a discussion around this topic now and the...

Asp.Net MVC: How to determine if you're currently on a specific view

I need to determine if I'm on a particular view. My use case is that I'd like to decorate navigation elements with an "on" class for the current view. Is there a built in way of doing this? ...

Styling Html Helpers MVC.Net

If i have a html helper like so: Name:<br /> <%=Html.TextBox("txtName",20) %><br /> How do i apply a css class to it? Do i have to wrap it in a span? Or do i need to somehow utilize the HtmlAttributes property of the helper? ...

Traditional ASP .NET Web Forms vs MVC

As someone with some winforms and client applications experience - is it worth going back and learning the way traditional ASP .NET pages work, or is it okay with moving straight into ASP .NET MVC? I'm kind of looking for pitfalls or traps in my knowledge of general C#, that I won't know from the screencast series and things on the ASP ...