asp.net-mvc

[nhibernate validator] how to validate custom properties?

I played around with nhibernate validator and got a nearly perfect solution. I can define a property to be validated and it's done on pre-save. But I have some cases where it's not working. Let's assume I have an object called person and via nhibernate I mapped the address(also an object) to be a property of person (in fact it's a lis...

How do I performance test my ASP.NET MVC website?

Hi folks, I'm wanting to find out how many requests/sec my asp.net mvc site (and asp.net mvc api) can handle. I've googled for some help and stumbled on this great slide show which talks about exactly the things i'm after. They also use a product called ApacheBench to hit the website. That application's website list it as a unix-type pr...

subsonic 3.0.0.3 doesent seem to update the database

hi there, im using subsonic 3.0.0.3 activerecord and everything is fine and i get no error but when i update a database, it never seems to actually happen, can anyone spot anything i am missing here?! ta code: var myquote = createNewQuote(); var gross = 36.00; myquote.totalcost = gross; // set the new value in my model UpdateModel...

ASP.NET MVC - How to pass an Array to the view?

Hello there, I'm struggling myself here, to find a easy way to pass an array from the controller to the view on ASP.NET MVC framework. so in my controller I would have something like: public class HomeController : ApplicationController { public ActionResult Index() { string[] myArray = { "value01", "value02", "value0...

jQuery Draggable, Droppable, ASP.NET MVC

I've been looking through a lot of tutorials on jQuery draggable/droppable, and trying to apply it to ASP.NET MVC, but I am really confused. Most of the samples I keep finding seem pretty difficult to understand at least where it pertains to where things are wired. I'm basically trying to have a targetable box (a 'roster') and a list o...

Listbox problems on postback with model

Hello I'm having problems with a Listbox, I'm going to add validation to a page where you add/edit a user, and when the page loads and I add a modelstate-error to force it to stop, it complains about my listbox doesnt contain any data with a key. On the page I have: <p> <label for="Email">E-post: *</label><br /> ...

What is the best way to implement AJAX using ASP.NET MVC and jquery?

I'm trying to figure out the best way to make an AJAX call to perform some action, and then do some jquery effect magic to make it look like something is happening. This is the basic idea: I have a link that when the user clicks it I need to update my model to say that the user is interested in an item (on the server side). However, I...

ASP.Net MVC post value in a combo box

We have a list of items on a ASP.Net MVC page, each row in the list has a combo box. When the user selects a value in the combobox, we would like the form to be submitted. We also need to be able to read which line the user was on and which value was selected. We have given each combobox a name that links it to the row on which it was ...

Enterprise MVC Application Project Setup With Entity Framework

So I was looking at this site which shows a pseudo project setup for entity framework. I know this article does not use MVC but it did get me thinking. Would you guys have your "model" tier to include all of the Entity Framework references, entities, business rules, repository facade, interfaces, buddy classes for validation, and the d...

ASP.NET MVC Data Annotations Validation ErrorMessageResourceType

When using Data Annotations Valition, everything works fine until I try to use resources. Here's the error I get: The name 'ErrorMessageResourceType' does not exist in the current context. And the code I used: using System.ComponentModel; using System.ComponentModel.DataAnnotations; using Microsoft.Web.Mvc; namespace Project.Models ...

How do you inject urls into jquery AJAX using ASP.NET MVC?

I'm trying to use AJAX via jquery with ASP.NET MVC, but I'm not able to hit my controller action and I think it might be because my url is not specified correctly. The problem is, I'm not sure what is should be! Say I have a controller named "Home", and an action named "AjaxAction", would the jquery look like this? $.get("Home/AjaxAct...

Impersonation in ASP.NET MVC

I have a MVC web application on an intranet and want to be able to create files on our FTP server to send to outside partners. The code for impersonation uses the WindowsImpersonationContext. System.Security.Principal.WindowsImpersonationContext impersonationContext; impersonationContext = ((System.Security.Principal.WindowsIdentity)U...

Unrecognized tag prefix or device filter 'asp' - MVC ViewPage With Master Page Specified In Controller

I have an MVC view page that uses a master page. The master page is not specified at the top of the view, but is specified in the Controller using the following method on the Controller class: ViewResult View(string viewName, string masterName, object model) This runs fine, but Visual Studio 2008 gives a warning in the aspx page: "Unr...

jQuery CRUD in ASP.NET MVC

Seeing as though our team maintain an Intranet which has clients users guaranteed to have javascript enabled we know that we can step in and start using jQuery more "thoroughly". Our system is very large, so even though we use areas in our ASP.NET MVC application the sheer amount of pages to add, edit, delete and view sets of data per s...

ASP.NET MVC Windows Authentication Question

Hello, I've built a custom login system for my asp.net mvc 1.0 web application as I store large amounts of user data for each user (I decided against trying to add custom tables for the windows authentication due to this). The login system basically uses SQL Server (2005 or 2008) and my own database and table structure which is pretty s...

Refactoring my route to be more dynamic

Currently my URL structure is like this: www.example.com/honda/ www.example.com/honda/add www.example.com/honda/29343 I have a controller named HondaController. Now I want to refactor this so I can support more car manufacturers. The database has a table that stores all the manufacturers that I want to support. How can I keep my URL ...

ASP.net MVC form Validation

I have went through most of the form validation for asp.net mvc like IDataErrorInfo, Xval, ValidationToolkit etc. This is specific with phone numbers or credit card validation where your model will have a property called "Phone" or "CreditCardNumber" but the UI/view will display the values in three text boxes( by splitting 3-3-4 in each ...

Rest-ful Basic Authentication with ASP.NET MVC

Anyone know how this works, I'm using the .net membership provider and just want to pull an xml list. I'm also using the .net mvc sdk. So here's the problem when I add the [WebApiEnabled] at the top of my controller I can successfully pull xml/json. But when I add [Authenticate] to the top of my controller I cannot login. As an exampl...

controller is not picking up the route

My route looks like: routes.Add(new Route("{companyName}/{action}/{id}", new MvcRouteHandler()) { Defaults = new RouteValueDictionary(new { controller = "CompanyController", action = "Index", id = 1 }), } ); my action: public ActionResult Index(string companyName, string id) { Response.Write(companyNam...

ASP.net MVC html helper extensions?

Does anyone know where I'd be able to find the definitions for the html helper (LinkExtensions) in ASP.net MVC? I'm trying to create my own extension to the ActionLinks and I want to build it upon what already exists. The LinkExtensions (from metadata) only gives me the: public static string ActionLink(this HtmlHelper htmlHelper, st...