asp.net-mvc

ASP.NET MVC - Executing Code everytime the Site.Master is processed.

I'd like to add a little variablility onto the path of my css link everytime my Site.Master view is processed. What is the correct way to do this? My code currently breaks on the Default.aspx saying I have not defined cssLink. Site.Master code below: <script runat="server"> void Page_Load(object sender, EventArgs e) ...

Visual Studio 2008: Synchronizing project structure with underlying file structure

Is there a way of making the (ASP.NET MVC) project structure reflect the underlying physical directory in the same way as ASP.NET Website projects are treated? - so you don't have to explicitly add files that are already in place via the Solution Explorer too. Thanks ...

ASP.NET MVC design

As I've stated before I'm working on a digg clone to teach myself ASP.NET MVC Inside and out but I've hit a road bump that I can't seem to avoid. I want to be able to optimize this application as much as possible so I have my DAL which is a bunch of classes of ...Repository : Repository. Now to help optimize for performance I have my b...

JQuery AutoComplete results format?

I have a string of values separated by a space that I return to the Jquery call, but it does not separate the words into rows. Should the data be returned as a string or a list or something else? ...

Mocking Requirements for TryUpdateModel in ASP.Net RC1

I am in the process of writing some unit tests for my controllers in RC1. Here is the controller's public signature I'm testing: [AcceptVerbs(HttpVerbs.Post)] public ActionResult AcceptColleague() { The implementation inside the AcceptColleague uses the TryUpdateModel(colleague) method of populating the Colleague obje...

Which View() to override in ASP.NET MVC Controller?

Which method View() is called last in the System.Web.Mvc.Controller? Or should I override each one? I would like to set some view data in my BaseController, which inherits from System.Web.Mvc.Controller. Edit: I would like to store basic user information like IsLoggedIn and BasicUserDetails { PermissionLevel, UserName, EmailAddress, U...

Verifying license information without a boolean check?

I'm currently using a simple XML file that contains license information along with the data's signature and public key. So far, this method is working great. However, I'm seeing one rather large security flaw... When my ASP.NET MVC application starts, it verifies the license and sets the "ValidLicense" bool property accordingly. During ...

Including Views in a Class Library

In a previous question I found out how to create a plugin architecture for MVC. I'm not the whole way down that path yet but I do have a nice way of splitting things up. One thing that is bugging me though is the intellesense for the View when they are in the Class Library. Developing them in the core MVC project and then copying them a...

How to migrate existing asp.net application to asp.net MVC pattern format

I want to migrate existing asp.net application to asp.net MVC pattern format now. What procedure should I will follow? Any step-by-step instructions would be very helpful. ...

ASP.NET MVC + fluent nNibernate, what IoC tool?

I'm working on a ASP.NET MVC project where we have decided to use Fluent nHibernate for dataccess. To enable loose coupling we go for a IoC/DI pattern. My questions is what IoC tool to go for. I've tried to find the differences between windsor, ninject, spring, structuremap and unity, but it's difficult to see the benefits each one has t...

ASP.Net MVC: Can the AuthorizeAttribute be overriden?

Hello, My current project is an internal web application built using ASP.Net MVC which I am adding authentication to. I have a pre-built HTTPModule which creates a IPrincipal with the appropriate roles. If the user isn't authenticated I get a user object with the role "Public" As this is an internal application most of the pages are pr...

ASP.NET MVC Equivalent to "override void Render" from ASP.NET WebForms

What is the ASP.NET MVC equivalent to "override void Render" from ASP.NET WebForms? Where are you opportunities to do some last-minute processing before the output is sent to the client? For example, I wouldn't use this in production code, but illustrates cleaning up the <title> and <head> markup for an entire site when placed in the ...

ASP.Net MVC View Architecture

Can the folders within the View have subfolders? if so, how does the Controller reach them? For example... I would like to have the following urls work correctly: Admin/Index Admin/Profile/Index Admin/Profile/Edit/1 Admin/Group/Index Admin/Group/Edit/1 So, would I create a folder for Profile and Group as a subfolder within Admin? I ...

Default MVC Web Application Database

When setting up a new ASP.NET MVC Web Application, the default connection string inside Web.Config is something like this: connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" I'm just wanting to play around with logging in and registering, etc but when I r...

Asp.Net MVC. Updating user control (Shopping Cart) with Ajax

I want to implement a user control which represents a list of the current items in a user's shopping cart, and which is included from within the a master page. I want to add a product to the shopping cart; the shopping cart should be automatically updated with an asynchronous call (JavaScript framework is jQuery) when a user adds a prod...

.getJSON produce a Download of a File ASP.NET MVC

I code a .getJSon, It does the job but I get IE to asked to download the file. Here is the code <script type="text/javascript"> $(function() { $('#id').click(function() { var dateReport = "01/01/2009"; $.getJSON('/Report/SendReport', { date: dateReport}, function(response) { if (r...

.Net mvc binders

Hello I'm having a disagreement with the model binders in Microsofts mvc framework. I have a base class for my domain models that have an id property that is readonly and type guid. But because it's readonly the binders can't set the value of the property. So am I totally screwed or can someone solve my problem? EDIT: Sorry as always t...

Updating javascript references after minifying during build process

What are the best ways of updating javascript references after minifying them (I use YUI Compressor)? I am using ASP.NET mvc and have a bunch or javascript references in each file during dev. At build time (using MSBuild) I minify all the files into single file. At the same time I want to replace all the references with the single refer...

Limiting the data returned by a controller

I need advice on how to return a limited set of data from an MVC controller. Lets say I have a class that is constructed like so: public interface ICustomerExpose { string Name {get; set;} string State {get; set;} } public interface ICustomer: ICustomerExpose { int Id {get; set;} string SSN {get; set;} } public class Cust...

Background Task still with cache? Or SO Team Find a Problem.

I am about to use what Jeff post about Easy Background Task in Asp.Net. I want to know if SO still use it or they found a Problem with the solution. Thanks ...