asp.net-mvc

ASP.NET MVC versus the Zeitgeist

ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarise how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of use and feelgood facto...

asp.net mvc, ajax and progressive enhancement

I am looking for a reliable technique for adding Ajax to a working ASP.NET MVC application. I want to use jQuery, and understand how to use the ajax functionality from jQuery. What I need to know is how I should write my controller so that I can run the site without javascript, but at the same time make ajax calls possible without the ne...

MVC .Net and IIS 5

What is the best way to get hosting of an MVC.Net application to work on IIS 5 (6 or 7). When I tried to publish my MVC application, all I seem to get is 404 errors. Iv done abit of googleing and have found a couple of solutions, but neither seem super elegant, and I worry if they will be unusable once I come to use a shared hosting envi...

Hierarchical Data In ASP.NET MVC

I am trying to come up with the best way to render some hierarchical data in to a nested unordered list using ASP.NET MVC. Does anyone have any tips on how to do this? ...

Unit testing MVC.net Redirection

How do I Unit Test a MVC redirection? public ActionResult Create(Product product) { _productTask.Save(product); return RedirectToAction("Success"); } public ActionResult Success() { return View(); } Is Ayende's approach still the best way to go, with preview 5: public static voi...

HTML.Button in ASP.NET MVC

Starting from ASP.NET MVC Preview 3, HTML.Button ( and other related HTML controls) are no longer supported. The question is, what is the equivalent for them? I've an app that was built using Preview 2, now I have to make it compatible with the latest CTP releases. ...

Where to put master page's code in an MVC application?

I'm using a few (2 or 3) master pages in my ASP.NET MVC application and they must each display bits of information from the database. Such as a list of sponsors, current fundings status etc. So my question was, where should I put these master-page database calling code? Normally, these should goes into its own controller class right? B...

MVC.net JQuery Validation

After trying to avoid JavaScript for years, Iv started using JQuery for validation in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good JQuery is. Firstly is there a way to get intellisense working for JQuery and its validation plugin, so that i don have to learn the api? Secondl...

ASP.NET MVC ViewData (using indices) Question

Hi, I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a Preview 2 solution) that uses an untyped ViewMasterPage like so: public partial class Home : ViewMasterPage On Home.Master there is a display statement like this: <%= ((GenericViewData)ViewData["Generic"]).Skin %> However, a developer on the team just ch...

What's the best method in ASP.NET to obtain the current domain?

Hi, I am wondering what the best way to obtain the current domain is in ASP.NET? For instance: http://www.domainname.com/subdir/ should yield http://www.domainname.com http://www.sub.domainname.com/subdir/ should yield http://sub.domainname.com As a guide, I should be able to add a url like "/Folder/Content/filename.html" (say as gen...

Paths in master pages

I've started to work a bit with master pages for an ASP.net mvc site and I've come across a question. When I link in a stylesheet on the master page it seems to update the path to the sheet correctly. That is in the code I have <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> but looking at the source once the...

MVC validation, will it conflict with other JS frameworks?

Hi, If I want to use the validation framework that you can use with ASP.NET MVC, will the javascript conflict with other javascript frameworks like jquery or YUI? ...

How would you implement a breadcrumb helper in asp.net mvc?

I know you could make a helper pretty easily given the data. So, if possible, please only submit answers that also include getting the data. ...

MVC Retrieve Model On Every Request

Let’s say I'm developing a helpdesk application that will be used by multiple departments. Every URL in the application will include a key indicating the specific department. The key will always be the first parameter of every action in the system. For example http://helpdesk/HR/Members http://helpdesk/HR/Members/PeterParker http://help...

Is anyone using the ASP.NET MVC Framework on live sites?

Is it ready for that? I've been playing with it for a short amount of time and it seems quite reasonable. Is anyone using it for live sites? any issues to be aware of? ...

How do you write a C# Extension Method for a Generically Typed Class

Hi, This should hopefully be a simple one. I would like to add an extension method to the System.Web.Mvc.ViewPage< T > class. How should this extension method look? My first intuitive thought is something like this: namespace System.Web.Mvc { public static class ViewPageExtensions { public static string GetDefaultPag...

Reading Body on chunked transfer encoded http requests in ASP.NET

A J2ME client is sending HTTP POST requests with chunked transfer encoding. When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when the request is loaded. However, when I read the Request.InputStream to the end, it returns...

How do you test cookies in MVC .net?

http://weblogs.asp.net/stephenwalther/archive/2008/06/30/asp-net-mvc-tip-12-faking-the-controller-context.aspx This post shows how to test setting a cookie and then seeing it in ViewData. What I what to do is see if the correct cookies were written (values and name). Any reply, blog post or article will be greatly appreciated. ...

Asp.net MVC routing ambiguous, two paths for same page

Hi! I'm trying out ASP.NET MVC routing and have of course stumbled across a problem. I have a section, /Admin/Pages/, and this is also accessible through /Pages/, which it shouldn't. What could I be missing? The routing code in global.asax: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resourc...

Using Asp.Net MVC with SharePoint

Hi, Is it possible to use the Asp.Net MCV framework within SharePoint sites? ...