asp.net-mvc

result.viewname is always string.empty

Hi, I cannot seem to return the result.ViewName for use in Nunit tests as it always returns string.empty. I have explicitly set the name of the view inside my controller and would expect the test to pick this up. I have had a hunt around and it seems that I should get the Viewname back if I set it explicitly. Any one got any ideas? publ...

Saving DateTime object on UK Dev Server vs US Live Server

I have a site that saves a date in my model to the database. After launching my site I realised that the server has US regional settings so I had to make sure that all date's on the public site were formatted in the UK format. However now when I go to my 'Create' page and choose a date and click save I get the error The value '22/11/20...

nhibernate with asp.net mvc

hai guys, I am new to nhibernate please suggest some article to start knowing about nhibernate with asp.net mvc ...

How to make a select list item selected in asp.net mvc?

Hi I have the following code but it never selects the value I want. List<SelectListItem> list = new List<SelectListItem>(); SelectListItem one = new SelectListItem() { Text = "MyTest", Value = "MyTest"}; SelectListItem two= new SelectListItem() { Text = "Test2", Value = "Test2" }; if (id == "MyTest") { ...

ASP .NET MVC: Redirect to a view if certain condition is not met

I finally got to try .NET MVC this weekend and, as was expected, ran into some hurdles. I am trying to password-protect my site while it's under development. The basic idea is very very simple: in my BaseController class (that inherits from the Controller and is inherited by all other controller classes) I check whether a certain Sessio...

How can I show UI hints for form controls like the Stack Overflow Career CV form does?

I'm trying to show some UI Hints on an ASP.NET MVC 2 app, much like the way they are displayed on the careers site when you edit/fill out your resume: when a form control has focus, a little description of how to enter the required information appears next to it. What is the best method to show these suckers... ...

'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' - ASP.Net MVC

I've been trying to run ASP.Net MVC 1.0 on one machine, but can't get past this. I create a new MVC project (C#). It creates all the folders, views, controllers, models etc. All good. Then, when I hit F5, I get the following: d:\VSCode2008\MVC\MvcApplication1\Views\Shared\Site.Master(19): error CS0117: 'System.Web.Mvc.HtmlHelper' doe...

TryUpdateModel with a currency formatted value?

Is there any way to get UpdateModel or TryUpdateModel to parse a money or currency formatted value such as $1,200.00 into a decimal without blowing chunks? ...

recommendation for web visualization dependency tool

i have a database that lists a bunch of applications and their dependencies. Some dependencies also have other dependencies. I am trying to figure out a web based way to visualize this on a web page so you can see the whole list of recursive dependencies throughout the data. i am using asp.net mvc. any suggestions? ...

Pass Data Arrays into jqgrid table

In my application, I will fetch a table of data from the server side when the page is first loaded, and use jqgrid to render it. I can't seem to get it to work, when I request for the DummyView page for the example below, the web browser pops up a message, asking me to download the application/json file, indicates that something is dee...

ErrorMessage is ignored in DataAnnotations DataType Attribute

I have a Model that is using DataAnnotations. Something like public class Appointment { [Required(ErrorMessage="Please enter your name")] public string Name { get; set; } [Required(ErrorMessage="Please enter your appointment date?")] [DataType(DataType.Date, ErrorMessage="Appointment date is not a date")] public Da...

Separation of Concerns the Repository Pattern & Entity Framework 3.5

Hi, I'm trying to be a better developer... What I'm working with: .Net MVC Framework 1.0 Entity Framework 3.5 I've been doing some reading and I think what i want to do is: Create a repository for each aggregate in the domain. An Order repository for example will manage an Order's OrderItems. Create a service layer to handle busi...

mixed MVC routing for MVC app under web forms app

I have an instance of BlogEngine.net installed at the root of my hosted server. I wanted to play with ASP.Net MVC to write a small app and installed that app under a folder off the root. I am able to see the http://example.com/testApp/ but the the routed pages like http://example.com/testApp/edit are giving 404's. I have searched arou...

Is there a way to have a dropdown combo in an asp.net mvc site with images instead of text?

Is there any way to have a combobox of images instead of text? ...

Move up and Move down items in listbox.

I have some items populated in the listbox from the database in my asp.net mvc(C#) application. I need to give an option to move up/move down the items in the listbox and store it back to the database with the updated order. I like to use jquery to move up / move down the items in the listbox. Whats the best way/soultion to do it? Or i...

Missing a part / layer in my app

Hello all! I have an asp.net mvc application with three layers: - data layer with entities and repository (nhibernate) pattern - service layer with services (functions), which communicates with data layer. - ui layer with asp.net mvc application, which communicates with service layer. The problem is that the data in my entities is diff...

Simple Convention Automapper for two-way Mapping (Entities to/from ViewModels)

UPDATE: this stuff has evolved into a nice project, see it at http://valueinjecter.codeplex.com check this out, I just wrote a simple automapper, it takes the value from the property with the same name and type of one object and puts it into another, and you can add exceptions (ifs, switch) for each type you may need so tell me what do...

Moq Roles.AddUserToRole test

I am writing unit tests for a project in ASP.NET MVC 1.0 using Moq and MvcContrib TestHelper classes. I have run into a problem. When I come to Roles.AddUserToRole in my AccountController, I get a System.NotSupportedException. The Roles class is static and Moq cannot mock a static class. What can I do? ...

MultiSelectList doesnt make items selected

Hello I have a problem with a multiselectlist, if I hover dropObjectcategories in debug-mode it contains 4 items that should be selected. List<int> selectedObjectcategoryIDs = new List<int>(); foreach (Objectcategory item in bo.Objectcategories) { selectedObjectcategoryIDs.Add(item.ObjectcategoryID); } MultiSelectList dropObjectc...

Loading content to a jquery modal plugin: iFrame or Ajax?

Hello, I'm developing a website for a client using ASP.NET MVC 1.0. There is a "profile's page" with many links releated to the profile. For example, "request contact", "see our diretions", "add as your friend", etc. I would like to use one of the many jquery modal scripts to show this links, without load them as a normal page/link, b...