asp.net-mvc

Can ASP.NET MVC routing and a classic ASP homepage (VBScript, not web forms) play together nicely?

Hello, We have a classic VBScript "default.asp" page in the root of our site. (This is a heavy, legacy page and converting it is not an option right now.) We also have a new ASP.NET MVC 2 application we want to host on the same site. Everything actually works great together! Except for one thing: requests to the root of the site (e.g., ...

ASP.NET MVC - Exception throw?

Hello there, I got a generic repository - should the repository be able to throw exceptions or should I keep it dumb? If I chose to throw exceptions from it, should the service layer then catch it and throw an exception with a more friendly message before it goes to the Controller? Pos1: Repository (Throw) => Service(Catch, Throw new) ...

WCF single vs multiple operations ?. design ideas.

We are developing a CRM application. All the business logic and data access go through WCF services. We have 2 options for communication between WCF and client (at the moment: ASP.NET MVC 2) One option is create method for each operations. Example GetCustomers() GetCustomersWithPaging(int take, int skip) GetCustomersWithFil...

How do I implement custom role authorization with ADFS in ASP.Net MVC2?

I'm pretty new with ADFS and and Custom Role authorization so any help (and a lot of patience) would be greatly appreciated. I'm trying to set up ADFS with custom authorization. I have the ADFS set up to return me a claim, from there I can get a username from the name token. However, I already have an existing roles table which I need t...

Quickly navigating through an ASP.NET MVC app in Visual Studio

I spent a fair bit of time developing Rails apps in VIM with an amazing plugin called Rails.Vim Whenever I wanted to navigate to a Model I would hit: esc :Rmodel topic[enter] to find the topic model. In this mode tab completion works so I could hit :Rmo[tab] to[tab][enter] (for an added bonus :RSmodel topic[enter] would split the w...

ASP.NET FormsAuthentication does not use default MembershipProvider

I have created a BasicMembershipProvider class that inherits from MembershipProvider, when implemented, the ValidateUser does not get called. This is my setup: web.config <membership defaultProvider="BasicMembershipProvider"> <providers> <clear/> <add name="BasicMembershipProvider" type="MyMVCProject.Providers.BasicMembership...

I am setting a cookie's expiration time 10 mins which is working fine in local system but on server, it's not working.

Hi all, I am setting a cookie's expiration time 10 mins which is working fine in local system but on server, it's not working. Please help me it's urgent. Vinay ...

ASP.NET MVC 3 Beta 1 Block Access to Razor views

Is there a way to block access (404) to the Razor views in MVC 3 beta 1? When I create a brand new blank site (IIS7) and then access /views/home/index.cshtml from the browser, instead of the 404 I get this [InvalidCastException: Unable to cast object of type 'ASP.Index_cshtml' to type 'System.Web.IHttpHandler'.] System.Web.WebPag...

Integrating Silverlight video to ASP.NET MVC

How do I integrate Silverlight video player and show video at MVC view page? ...

LINQ extension method help sought II

Hello all, I'm wondering if there's a way to make the parameters of this extension method 'intellisensible' from my view. at the moment, i can get a tooltip nudge of what the parameters (in the controller action method) are but would love to confidently intellisense type the parameter names for 'safety'. anyway, without further ado, the...

Use silverlight in asp.net MVC

Is it possible? I'm not familiar with silverlight architecture, but i know about wpf and asp.net mvc. is it possible to replace mvc view page with silverlight ones? ...

MVC workflow question

I'm building an ecommerce application and I have a controller that is responsible for the buy process. What I've noticed in creating the methods within these controllers is that each method is responsible for processing input from previous view. So I have a Quote method that returns a Quote view, and the user is interacting with the vi...

Pattern for retrieving complex object graphs with Repository Pattern with Entity Framework

Hi, We have an ASP.NET MVC site that uses Entity Framework abstractions with Repository and UnitOfWork patterns. What I'm wondering is how others have implemented navigation of complex object graphs with these patterns. Let me give an example from one of our controllers: var model = new EligibilityViewModel { Country = pers...

Removing ModelErrors from ModelState once written to ValidationSummary()

I may be approaching this from the wrong angle entirely, but hopefully someone will know a way of acheiving what I'm after. I reference a web service, which returns an ErrorInfo object. I add each returned error to the ModelState as a ModelError: foreach(ErrorInfo error in serviceResponse) ModelState.AddModelError(error.AssociatedF...

Language support issues with ASP.NET MVC RSS feed

I want to have an Arabic and English language RSS feed, but right now only the English feed works correctly. Any ideas what might be wrong? ...

How to trigger RenderAction from dropdown list selection?

I have an ajax form. In this form i have 2 drop down lists (Office and Departments) and a "Filter" Button. When filter button is clicked my ajax form is set to update "content_main" with my new filtered list. My question is... how can i get Office (when a selection is made) to trigger a RenderAction on the DIV element containing my li...

Having 304 code not get logged by the trace.axd

I have a typical MVC site, while reviewing the trace.axd I'm getting a lot of noise from my JS files which all return http 304 codes(Not modified). Is there a way to have JS files, or 304 codes be filtered out my the trace.axd? ...

Using LINQ to query collections within collections in am MVC View

I have a "Product" and a "Benefit" class which is shown below: Now, I want to query a collection of products from within my view. I've created a LINQ query that gets the products but I want to get at the collection of benefits that belong within the product. Code within my view (however this just iterates each product and I need to ite...

ASP.NET MVC: cache with non-cachable portions

I have a heavy page that is cached. This is okay for anonymous users. They all see the same page. The problem is for logged in users. They should have minor parts of the page re-rendered on every request (like personal notes on content in the page, etc.) But still all the rest of the page should be cached (it does tons of SQL and calcua...

Removing direct reference to URL in view when two different URLs map to single controller action?

Basically I'm looking for the best way to remove the need to hard code any actual URLs within views when two different URLs call the same controller action. As shown below, two routes define different URLs, one for creating a new customer, whilst the other is for editing an existing customer. Inside the controller action it determines ...