Questions tagged [asp.net-mvc-migration]

Questions related to migrating ASP.Net Winforms to ASP.Net MVC as well as upgrading code from older MVC versions to the current one.

16 questions
11
votes
3 answers

Why `DatabaseGenerated(DatabaseGeneratedOption.Identity)` doesn't work in MVC 4

I was trying to move my MVC 3 project to MVC 4 but when I wanted to move this model: public class Link { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public Guid ID { get; set; } [DisplayName("Shorted URL")] public string…
ahmadali shafiee
  • 4,350
  • 12
  • 56
  • 91
6
votes
2 answers

Razor View Syntax doesn't recognize the "@" in an HTML attribute

I am migrating a project from MVC 2 to MVC3 and the razor view engine. In MVC 2, I would have the following html:
When using razor, I tried the following, which renders the literal text…
scottrakes
  • 735
  • 9
  • 26
6
votes
2 answers

Razor helper method not working after upgrade from MVC 3 to 4

I have a helper method in a file under the App_Code directory. The method works perfectly fine in MVC 3, but after upgrading to MVC 4 it doesn't. It's failing at the first @if() block... [Edit] This looks like a parsing error in the Razor engine. …
Silkster
  • 2,190
  • 15
  • 28
3
votes
1 answer

Bundling is working BUT minification is NOT working after migrating from Asp.Net MVC 3 to MVC 4

As I have migrated from Asp.Net MVC 3 to MVC 4, everything working fine with Asp.Net MVC 4 except minification. Issue My bundling works BUT minification is NOT working. Bundling code public static void RegisterBundles(BundleCollection bundles) …
nunu
  • 3,184
  • 10
  • 43
  • 58
2
votes
1 answer

Razor: Cannot render Html.Label helper in a @Section (outputting source only)

I was unable to figure out how to use @class inside Html.LabelFor, so I updated an extension helper for Html.Label with code found on SO. My LabelExtension.cs file has the following class: public static class LabelExtensions { public…
REMESQ
  • 1,190
  • 2
  • 26
  • 60
2
votes
1 answer

MVC DateTime format can not be parsed

after recently upgrading from MVC3 to 4 I am having some issues with datetimes. I display a date property like this: <%: Html.DisplayFor(m => m.InvoiceDate, "datetime")%>  "datetime" is a display template which looks like this: <%@ Control…
2
votes
1 answer

Using ExceptionFilterAttribute in upgraded MVC project

Is it possible to use ExceptionFilterAttribute in a project the was created with MVC2 and upgraded to MVC4? It is not a Web API project, and I cannot seem to get the exception to catch using the ExceptionFilterAttribute. Is there any way to make…
2
votes
2 answers

How is it possible that Session is null in the AuthorizeAttribute.AuthorizeCore method?

I have a custom attribute class which inherits from AuthorizeAttribute. Sometimes the parameter httpContext.Session is null. How is this possible? The Session supposed to be alive as long as I am logged/active, right? I am not brwosing for 20…
Martijn
  • 24,441
  • 60
  • 174
  • 261
1
vote
2 answers

Viewengine not looking into areas for views in asp.net mvc3 upgrade?

i'm upgrading my asp.net mvc app to the MVC 3 from mvc 2. I had everything set up so that there were no areas, but now i have to move the old application into its own area so i can start a new one. The new area is working great, but for some reason,…
bpedlar
  • 31
  • 3
1
vote
2 answers

SiteMapPath using MVC 3 Razor

I'm currently converting a project from Asp.Net MVC 2 to MVC 3 and I'm having trouble finding out how to do this... asp:SiteMapPath ID="SiteMapPath1" runat="server" using Razor? I've been playing with @SiteMap but other than getting the current…
Frank
  • 11
  • 1
  • 3
1
vote
1 answer

MVC3 ValidationAttribute break

I upgraded my project from MVC2 to MVC3 and all custom ValidationAttributes broke. At some point in the model binder phase, it throws this exception: Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name:…
1
vote
2 answers

MVC 5 Migration Issue

I have migrated my project from MVC 4.0 to MVC 5.1. I have followed all the steps as mentioned here http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2 Afrer that I have installed…
Yass
  • 592
  • 1
  • 8
  • 30
1
vote
2 answers

Migrating web application to asp.net mvc

I need your advice regarding migration. I want to migrate existing project to ASP.NET MVC and I can figure out the proccess except of url rewriting issue: for example how can I make following route:…
Alex L
  • 29
  • 5
0
votes
1 answer

Migration from ASP.NET MVC 1.0 breaks Reponse and Request objects

I've been in the process of attempting to deploy an ASP.NET 4.0 (webform) project on a server that is running an ASP.NET MVC 1.0 application in it's web-root. I was slowly making progress, but hit a wall, so I decided to recompile the MVC app…
Josh
  • 776
  • 6
  • 20
0
votes
1 answer

How can I migrate from MVC5 to MVC4?

I want to migrate from MVC5 to MVC4, because my server is not supporting MVC 5 and giving me so many issues, Thanks in advance.
Afzal Ahmad
  • 586
  • 5
  • 20
1
2