asp.net-mvc

What happened to Html.Mailto from MVC preview to final?

In some of the previews, there was an HTML-helper method for building mailto-links. http://blog.wekeroad.com/2007/12/05/aspnet-mvc-preview-using-the-mvc-ui-helpers/ I am not able to find that in the final release. Am I missing something? ...

TDD with ASP.NET MVC 1.0

Where can I find a good tutorial on TDD with ASP.NET MVC 1.0? I'd prefer a video tutorial but a text tutorial would be fine as well. I have a new project starting soon and I want to start off on the right foot. ...

Where should be the validation in a ASP.Net MVC scenario having Repository, Service Layer and using Model Binder?

Related: What’s the best way to implement field validation using ASP.NET MVC? Let's suppose a solution with the following projects: Foo; // the MVC web project Foo.Models; Foo.Repositories; Foo.Services; Foo.Models is the domain of the application with all the entities, doesn't matter if using EF, NH, POCO or whatever. Here an exampl...

Authorization based content from the Data Layer

Hey I'm working on a web-forum, of a sorts, or well, trying to design one using the ASP.NET MVC. However, user-role based content is quite a larger challenge than simply using a [Authorize] attribute, since the given output differs depending on the access roles. So while a user member in the Moderators role should be able to see secret...

How do you deploy an ASP.NET MVC site using StructureMap 2.5.3 in a medium trust hosting envrionment?

I am getting a SecurityException (as seen below), even with [assembly: AllowPartiallyTrustedCallers] in my AssemblyInfo.cs. I am deploying to GoDaddy, which is a medium trust environment, which I don't think StructureMap is set up to run under natively, although the 2.5.3 release notes mention adding the AllowPartiallyTrustedCallers att...

solution for popup page as modal

I was using window.showModalDialog() but doesn't work on all browsers. People recommends me jquery, thickbox and also this contact Example but the problem is when i submit the page, server will send me another page, and that page will replace my original page! so actually it doesn't fulfill my requirement. My requirement is on button...

asp.net mvc modular application howto/recommendations

Does anybody have a recommenation for building ASP.Net MVC application in pluggable modular way? I mean some blog-posts/tutorials etc. I just read Hammet's MEF and ASP.NET MVC sample blogpost, but I dont find MEF mature enough to use it in production yet. I wasn't able to google out any other relevant posts on this topic... I know I cou...

Why does the default model binder not validate fields when they are not in form data?

Hi, Let's say you have simple object like this : public class MyObject { public int Test { get; set; } } And you count on the default model binder to make sure the user does not leave the "Test" field empty when posting a form like below : <form method="post" action="/test"> <p> <%=Html.TextBox("Test") %> <%...

Mocking a Customer SessionHandler Object in ASP.NET MVC for Unittests with Rhino Mocks

Hi folks, I currently use the following approach to create a strongly typed object representing session variables. public abstract class SessionController : Controller { private const string SESSION_NAME = "UserSession"; public SessionData SessionData { get { SessionData sessionData = (SessionDa...

Difference between HttpContext.Current and Controller.Context in MVC ASP.NET

Hi, I am working on an MVC ASP .NET application. I am relatively new to both. In a controller I am trying to get the current log on user, for which there seem to be two ways of doing this: System.Web.HttpContext.Current.User.Identity.Name Or HttpContext.User.Identity.Name What is the difference between these? As far as a I can te...

ASP.NET MVC Development tool

Following on from my previous question, If I am beginning to learn asp.net MVC, will the express edition of visual studio web developer be enough, or should I consider the expensive full version of Visual studio. What are the limitation of such express version I may run into? or am I better using an Expression tool? (or is this something...

add querystring parameter in URL

I am using asp.net mvc. here I am not asking on controller logic but at view page.And I am not messing with default setting of url routing. I have a view having some url like /controller/action?CID=2 In this view I want to put Link having above structure but with different controller. The point is get the current url parameter and pu...

Download ASP.NET MVC reference and integrate it with local MSDN Library

Is there a way to download ASP.NET MVC reference and make it available through the local MSDN library? I am tired of going to Microsoft's site everytime I need a simple class or method documentation reference. Thanks! ...

ASP.NET MVC & Expression XAML - How do I integrate?

Some Background: ASP.net MVC is primarly a paradigm shift in the way you structure and develop ASP.NET applications. Shifting from a "code behind" type of mentality to more of a standard MVC Ruby on Rails like mentality. I applaud it's efforts as a simlifying tool towards unit testing ease and seperation of code (although the html inl...

Why should you delete using an HTTP POST or DELETE, rather than GET?

I have been working through Microsoft's ASP.NET MVC tutorials, ending up at this page http://www.asp.net/learn/mvc/tutorial-32-cs.aspx The following statement is made towards the bottom of this page: In general, you don’t want to perform an HTTP GET operation when invoking an action that modifies the state of your web application. ...

FallbackToEmptyPrefix not set correctly in DefaultModelBinder in .NET MVC

I am extending the DefaultModelBinder class in order to do some custom model binding. I am overriding the BindProperty method like so: protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, System.ComponentModel.PropertyDescriptor propertyDescriptor) { if (prope...

ASP.NET MVC Authenticated User Being Directed to Wrong Route After Login

I am building an ASP.NET MVC application using the 1.0 release using Visual Web Developer Express (temporarily). I am using the SqlMembership Provider and forms authentication to handle security for the site. My site security requires the user to login before seeing anything -- there are no anonymous user pages except for the login pag...

Large ASP.NET MVC Application Considerations

I've done a large study into using MVC and thanks to the people here a lot of the issues revolving around it have been cleared up for me. The problems I'm having now revolve around the sheer size of our application and how it would be organised within the project itself. For example, we have url's such as http://mylocalapp/folder/neste...

What is the better way/place for validation ?

In my asp.net mvc application i have service layer, which operated with business object, pass its to repository layer and return to controller. No i can't decide where i need to validate object. First place - use data annotation validation with attribute of component model annotation in business objects class, for example: [AcceptVerbs(...

SubSonic ASP.NET MVC sample in Visual Web Developer Express

In Visual Web Developer Express 2008 the SubSonic ASP.NET MVC template doesn't seem to work with a new database I added. I removed the Chinook Database and created my own one. I understand the the .tt files in the Models folder are used to generate code, but they don't (despite changing the ConnectionStringName to what I set in the web.c...