asp.net-mvc-2

ASP.NET mvc 2 - How to add a "confirm your e-mail address" field?

Let's say I have a model that looks like this: public class MyModel { [DisplayName("Email:")] [Required(ErrorMessage = "Email is required")] [Email(ErrorMessage = "Email is invalid")] public string Email { get; set; } } In ASP.NET MVC 2, I'd render the text box and validation like so: <%=Html.LabelFor(x => x.Email)%> ...

Entlib validation ErrorMessage not working with MVC ValidationMessageFor

I'm using the combination described on the title. If I use DataAnnotations the ErrorMessage I set is shown correctly on MVC 2 form validations. However if I switch the validation to Entlib 5, with the same ErrorMessage property set, the error message shown is a deafult one, depending on the validator, and not the one I set. Before, work...

Does a CMS plugin for .net MVC project exist?

as SO digested my title i found If you're going to integrate a ASP.NET WebForms CMS with ASP.NET MVC 2, you're going to have to do your integration at the API level (assuming the CMS has an API). That raises the question - do any of projects exist where an api mapping some of the housekeeping functions of a generic CMS can be leverage...

Html.Encode does not work atleast not as i think it should

In asp.net mvc 2 view i am trying to render something if true. In code below i am trying to use Html.Encode(x) to render value into page but it does render nothing. What is wrong with if statement with html.encode? Works <%if (!ViewData.ContainsKey("DisplayQtyPrice")) {%> <%: entry.Amount %> <%}%> Does not work <%if (!ViewD...

Asp.net MVC2 ModelBindingContext.ModelName empty

I'm not even quite sure where to start explaining this problem. I've been working on this for about the past 10 hours without a clue as to what the root cause is. If any additional details are needed, I'd be happy to provide. I'm just guessing at what is relevant at this point. I have an MVC2 site with routes set up by by Steve Hodgkiss...

.NET/MVC2 data caching using Entity Data Models

I am having a strange caching problem and I believe it might be related to the fact that I am using a Entity Data Model as my data source. The problem is that I can update the database directly and it doesn't reflect on the actual site until I republish the project. The data does display properly when viewing the project locally. The o...

Example of how to use active record with asp.net mvc

I am looking for the best approach to using NHibernate and MVC.net. I have gone through http://www.codeproject.com/KB/architecture/NHibernateArchitecture.aspx Someone has pointed to the use of Castle project Active record. My aim is to eliminate the need for any nhibernate dependencies within my domain. I want a quick and easy do...

Where to store feedback UI data in ASP.NET MVC 2?

Hey guys I'm really new to both ASP.NET MVC and the MVC pattern generally. For context, I'm currently running .NET 4.0, MVC 2. I know that MCV 2 has a bunch of built in features for: validation (both client and server side, through a variety of ways) error handling (via attributes and other methods) But what should be used to retu...

How to read username and password from http GET in .NET MVC controller?

How can I read the username and password from http GET in .NET MVC controller? I am using a jQuery $.ajax call and I am passing username and password in as a setting. Is this secure? If my server is ASP.NET MVC 2 how can I retrieve the username and password from the request? My end goal is to make a secured jsonp call. here is ho...

Data Generation for MVC2

Hi, does anyone know any tool for 'code generation' using MVC2? I know that ASP .NET has 'Dynamic Site' template (I know that don't generate any code), but I searching for one that generates code using MVC2. Thanks ...

Validation with nested ViewModels in ASP.NET MVC2

I'm having a weird (at least to me) problem with validation using ViewModels and Html.EditorFor(T). The validation errors produced by <%: Html.ValidationSummary(false) %> lists properties which are not invalid, and do not correspond to the values in the ModelState dictionary when I view it in debug. I'm using strongly typed view models c...

Building sharable ASP.NET MVC UI Components

We have two websites that share some business processes and UI elements. Lets focus on a contrived example: we have an apartment rental site and a boat exchange. For instance, on our apartment rental website, we may want to let users bid to buy boats. On our boat website, we may want to let users search for apartments. An obvious s...

Can anyone share the experience of migrating an Enterprise site from MVP to MVC?

Our site current uses UIP (Microsoft Application Block - no longer supported). Given the power and benefit of MVC, I would like to know the experiences of other attempting or having succesffully attempted this? ...

Using IIS7 and vs2010 to do remote debugging with MVC2 and Windows Authentication

What I am doing I am building an MVC2 website with Windows Authentication using Visual Studio 2010. I want to debug the website using IIS7 and access it from a browser in a virtual machine (in order to sign in using different users with different privileges). Problem When I try to access my website from my virtual machine, I get the ...

Page-level localization resources in ASP.Net MVC2

How can I best use Resource files for each page when doing localization in asp.net mvc2? Is there a naming convention or approach where the framework will automatically detect the correct resources and pull in those values? Background: I have separate resources working for the entire site, but I would like to be able to split them by pa...

jQuery AutoComplete does not show up

Hello, Inside a jquery dialog I would like to use the jquery autocomplete feature of jqueryUI. I have then prepared an action in my Controller (I am using ASP.NET MVC2) that is as follow public ActionResult GetForos(string startsWith, int pageSize) { // get records from underlying store int totalCount = 0; string whereClau...

Correct way to reference content in MVC

When running my web app on my local machine i can ref css/scripts/images using: <link href="/Content/Site.css" rel="stylesheet" type="text/css" /> But when I deployed to my Development server, it wasn't able to find any of my content. After researching the issue everyone suggests using the below method: <link href="<%=Url.Content("~/...

Add a search box to a master page

I'm trying to add a search box to a master page in an ASP.Net MVC web app. What's confusing me is how to properly implement it in the master page. So the user types in data into this search box, how should the data be handled from an MVC perspective?? I know I could use he master page's code behind, but I shouldn't. I'm currently try...

Proper error handling in ASP.NET MVC2

I have an override OnException(ExceptionContext filterContext) in my base controller to catch the app during any errors, and then log them. The problem I'm getting in my app is this particular method is fired off four times for certain errors. I'll walk you through a scenario: Let's say i navigate to: http://localhost:180/someController...

.NET/MVC recursive record listing

I'm trying to make my content CMS more user friendly by listing content in the following fashion: Parent - Sub Page - - Sub Page - - - Sub Page - - - - etc... Using .NET/MVC2, where would this function be defined and how would it be called. This is my page listing my content: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Sh...