asp.net-mvc

How to edit and continue in Visual Studio 2008 and ASP.Net MVC?

I'm trying to get edit-and-continue working with Visual Studio 2008 with an ASP.Net MVC project. I'm running 64-bit, so that adds to the problem. In Configuration Manager, my active solution platform is x86 and all the projects are targeting Debug x86 as well. In the project properties I have "Enable Edit and Continue" selected. In To...

Best practices for HttpContext and testable controlers in ASP.Net MVC

Update: Based on a couple of the answers I have received, I just want to make clear that I am well aware how to go about mocking HttpContext using a mocking framework. I am more interested knowing what the pros and cons of mocking HttpContext are when compared to using wrapper classes around HttpContext. I'm looking for opinions on h...

Integrating asp.net webforms and mvc

I am developing an asp.net mvc website product that needs to allow customers to add their own content pages, outside of the project. So the product will deliver a core set of pages (views) all using a master page. The clients can add their own web pages (.aspx) which I was hoping they could inherit from the MVC masterpage. Obviously...

How to retrieve BOTH the markdown and html using the wmd-editor control?

I am using WMD-Editor and would look to store both the Markdown and HTML version of the text that is entered. I can only seem to get access to the output as Markdown OR HTML, but not both. I am using ASP.NET MVC and am trying to get something like the following code to work ... just don't know how to get at the HTML. Here is a snipp...

ASP.net MVC project structure

Hi guys I have created the following project structure for my new asp.net mvc project any I was after some feedback as how other people are structuring their projects and if I would improve mine... Here is what I have so far: +Assets -+Images -+Scripts -+Stylesheets -+... 'More things like the above here +Controllers ...

How to create a dedicated task for background tasks in .NET MVC?

This question is in regards to this blog entry. http://blog.stackoverflow.com/2008/07/easy-background-tasks-in-aspnet/ All the way at the bottom Jeff mentions he uses a dedicated task to solve this. I searched on SO and found this solution http://stackoverflow.com/questions/733643/scheduled-jobs-in-asp-net-website-without-buying-dedica...

Design suggestion for passing parameters in MVC

How do you pass parameters in ASP.net MVC over two views, like a wizard? Or what is the best practice? I am working on an inhouse bug tracking ASP.net application being moved to MVC, I can't seem to shake the ASPX out of my head and am going in circles. In the ASPX application. Page1 -> Select Project, pass projectId in Querystring P...

ASP.NET MVC Membership Reserve

I want to be able to prevent users from registering using specific usernames such as "Admin", "Administrator" etc. Does the MVC MembershipService have a way of doing this or will I have to implement my own method to check each time a user registers? Thanks TheLorax ...

asp.net mvc legacy route mapping

I have a legacy asp.net website I am migrating to asp.net mvc. I would like to permanently redirect existing urls to the asp.net mvc controllers. I have controllers with views for the new location for these links, and I would like to do a 301 redirect on the existing pages to the new views. I have two different types of urls: http...

Deploying asp.net mvc iis6.0 how to change route TO include .aspx

Hi guys This is my routing tables where do I put the various '.aspx' registrations? //Turns off the unnecessary file exists check this._Routes.RouteExistingFiles = true; //Ignore text, html, xml files. this._Routes.IgnoreRoute("{file}.txt"); this._Routes.IgnoreRoute("{file}.htm"); this._Routes.IgnoreRoute("{file}.html"); this._Routes....

Creating a separate module in MVC like you can do in DotNetNuke

I've newly started to open my eyes for ASP.Net MVC, but on the site we are currently working on we use DotNetNuke, and I actually like the way you can create new "Modules" and just plug them in to your site with ease (If the module is coded right that is). Can you achieve this when using the Asp.Net MVC pattern? That you have a co-worke...

Understanding the ASP.NET MVC execution pipeline to generate a page creation time

Where do i start the stopwatch and where should it stop? The logical place for the stopwatch to start should be the controller action method, yes, no? But where should the stop the clock? I would like to think that it goes at the end of the master page? It doesnt make sense to stop the watch at the end of the controller action method...

Secure voting

I'am writting voting web aplication and I'm not sure how to implement it. One user can vote for many pictures but he can't vote for one many times. What should I save in database or in cookies? I'm using ASP.NET MVC. Users are NOT authenticated. ...

MVC Implementation where a Search Engine is the Model

Maybe I am mistating the problems and conflating the answer with the questions, but please here me out. I would like to think (communally, with you) about a site that is based on any any of the MVC frameworks(something PHP or ASP.NET MVC, whtever) that would use a search engine (lucene/solr, FAST ESP, whatever) as the back end of the Mod...

ASP.NET MVC, EF, 'IsReference' property specified was not found

Hi Using Entity Framework, I suddenly get this strange error after publishing my asp.net mvc project onto my Win2003 server: [CustomAttributeFormatException: 'IsReference' property specified was not found.] The error occurs when I need to update or delete an entity. I haven't changed anything (and yes, it's actually true :-) in m...

Problem with sorting dates with jquery tablesorter

I am using tablesorter plugin to sort my tables in an MVC .NET App. Most of my columns are strings and I'm having no problems with them. Neither with the numeric ones. The thing is my datetime columns are also getting sorted as if they were strings. They get sorted like this: 01/04/2009, 02/02/2009, 03/08/2009, etc. I obtain the data fro...

What should a .NET developer know about MSBuild?

95% of my time I program ASP.NET (MVC) web sites. Should I care about MSBuild? ...

Can MVC routing be used to create a dynamic content management system with dynamic pages stored in db rather than in view pages

Are there any good examples of mvc routing wherein every 404 page not found request is routed to a standard view in MVC which basically pulls the content from the database. ...

MVC Models not successfully updated but can't find reason

This has been driving me nuts. I keep getting the following exception System.InvalidOperationException: The model of type 'Models.Expense' was not successfully updated. at System.Web.Mvc.Controller.UpdateModelTModel at System.Web.Mvc.Controller.UpdateModelTModel atMVC.Controllers.BaseExpenseController.Edit(String id, FormColle...

Is there a way to nest (or escape) ASP.NET inline code inside HTML angle brackets?

is it possible to do something like the following in ASP.NET: <tr<%= index++ % 2 == 0 ? " class=\"alt-row\"" : ""; %>> in other words, is there a way to escape the angle brackets for the inline code block or something? (i know the alternative is: <% if (index++ % 2 == 0) { %> <tr class="alt-row"> <% } else { %> <tr> <% } %> ...