.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Migrating MVC1 application to MVC2

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
I am having a Asp.net MVC1 based application which needs to be migrated to Asp.net MVC2. I opened this application in vs2010 and it automatically migrated it to MVC2. However one of its code line is creating problem during page exceution. I have following line in Application_start funtion of Global.asax ModelBinders.Binders.DefaultBinder = new Microsoft.Web.Mvc.DataAnnotations.DataAnnotationsModelBinder(); This is because Microsoft.Web.MVC.DataAnnotations dll is missing in MVC2. I tried to skip this error by commenting this code but that is also giving error. Can somebody please guide me about its replacement code. Thanks in advance Cheers TicArch

View Complete Post

More Related Resource Links

Tip #107 Did you know . How to improve debugging performance for MVC2 application in Visual Studio 2

VS2010 Ultimate included IntelliTrace functionality by default.  IntelliTrace captures events (e.g. exceptions), and can affect performance of debugging. The typical performance hit is about 5% in the default mode (collection can be increased to...(read more)

Why does MVC2 reset my Context.User but MVC1 doesn't?

The question comes from a previous thread, but I would like to ask a more specific question from anyone in the know.Why does MVC2 reset my Context.User, discarding changes made in Application_AuthenticateRequest but MVC1 does not?Repro is pretty simple:Start an MVC1 and MVC2 new project. In both of them add the following code in global.asax: protected void Application_AuthenticateRequest(Object sender, EventArgs e) { if (Context.Request.IsAuthenticated) { FormsIdentity ident = (FormsIdentity)Context.User.Identity; Context.User = new System.Security.Principal.GenericPrincipal(ident, new[] { "FooAdmin" }); bool result = User.IsInRole("FooAdmin"); } } // break hereNow in both HomeController.cs files change the Index Action to: public ActionResult Index() { bool result = User.IsInRole("FooAdmin"); ViewData["Message"] = ""; // break here return View(); }Deploy to IIS, attach debugger on the "// break here" lines and then login to each site in turn.You should find that under MVC1 the result variable at both breakpoints is true, but in MVC2 it is false in the Index action.Anybody have any idea why? Is this a bug or by design? Any way around it?

ASP.NET MVC2 Empty Web Application creates ASPNETDB database when I try to add user to my own databa

I created ASP.NET MVC2 Empty Web Application, I added my own database called 'Database1' and I added to this database Microsoft users, permissions etc. tables but when I create user in ASP.NET Configuration - it creates in catalog /App_Data database called 'ASPNETDB' and adds users to this database - I don't want that - I have my own database for that - what is going on ??In Web.config my ASP.NET MVC application I have only one connectionString - my own:<add name="Database1Entities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> so what is going on ? How can I add users to my database 'Database1' ?

VWD2010, MVC2, Html.ActionLink and Application[]



This is my code:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
    if (Request.IsAuthenticated) {
        <%:Application["Welcome"] %> <b><%: Page.User.Identity.Name %></b>!
        [ <%: Html.ActionLink(Application["LogOut"].ToString, "LogOff", "Account") %> ]
    else {
        [ <%: Html.ActionLink(Application["LogIn"].ToString, "LogOn", "Account") %> ]


What I want to do is pretty simple, I set appropriate values in the application array at the global.asax level and would then want to see those values be written in place of the default ones. That obviously does not happen or I wouldn't be writing here :-P


It gives out an error saying it doesn't find an correct overload for the method ActionLink(or something along these lines anyway).

Clearly, that's wrong :-P since I would expect it to display m

Getting error while migrating a web application from 1.1 to 4.0


I have a web applicaiton in VS 2003 (1.1) that i want to upgrade to Visual Studio 2010 and target to framework 4.0.

My Approach - 1. Open in VS 2010, Covernt it to VS 2010. 2. Then, target the application to framework 4.0.

The application solution has two projects, one is default web project (inetpub\wwwroot\1stproject - Main project that contains all ASP.Net forms, web.config etc.) and  other one contains BL and DAL.

When I try to open and convert the applicatoin in VS 2010. It converts the second project (BL and DAL) successfully without having any error but failed to convert the main project and gives the following error-

"Internal MSBuild Error: Setting Property without a project and without a pending global properties collection."

How can this error be solved??

-Neelesh Rawal



Migrating .Net 1.1 web application to .Net 3.5


I have started migrating a web application in .Net 1.1 to .Net 3.5. I used Visual Studio 2008 Migration Wizard and open the v.1.1.4322 solution file. After the migration is completed, there are few error messages and a plenty of warning messages related to access specifiers. But my concern is, when I look at the folder structure in the Solution Explorer is, most of my business logic class files are moved to App_Code folder. There are 5 or 6 web projects inside my solution and the project files (.csproj) of those web projects are moved to _vti_cnf folder. Now, in the Solution Explorer, those projects are not listed as a separate project, instead, it is listed under http://localhost node.

I don't understand why it is happened. I am not sure, will the same be happening when migrating all .Net 1.1 app to .Net 3.5. Please clarify if anyone has the idea about what & why it is happening...



Migrating an FBA application from 2007 to 2010



I was hoping to get a bit of advice or guidance for an FBA scenario, so here goes:


In my 2007 farm I have a web app, “a.domain.co.uk”, with Basic authentication in the default zone. I have extended the app into the internet zone and set up FBA (SQL membership provider) using the CKS:FBA project code. This zone also has anonymous access enabled. This is available as “b.domain.co.uk” and is published to the internet.

We also have two other services “c.domain.co.uk” and “mysites.domain.co.uk” where, like “a.domain.co.uk”, users login with their domain credentials using BASIC authentication/SSL.

Migrating a large web application to ASP.NET MVC


Recently I had the luck of migrating some classic ASP pages to ASP.NET MVC. I would share some of the experiences below.

ASP.NET webform and ASP.NET MVC can coexist just fine

We have a huge existing ASP.NET webform application with thousands of pages. The challenge therefore is that any addition developed using ASP.NET should not affect the operation of existing webform pages. The mixing of ASP.NET Webform and MVC has been studied previously by many people. It is fairly easy to find some articles by searching "asp.net mvc and webforms together" on your favorite search engine. Basically, we need to include 3 additional DLLs in the web application:

  • System.Web.Routing
  • System.Web.Abstractions
  • System.Web.Mvc

The System.Web.Routing is not part of ASP.NET MVC, but is used by MVC to route a web request to a controller. The System.Web.Abstractions add a wrapper to some built-in asp.net classes such as Request, Response, Session to decouple MVC code from the ASP.NET built-in classes so that these classes can be mocked in testing projects.

The first step to enable routing is to add the URLRoutingModule to the list of HTTP Modules in web.config:

<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,System.Web.Routing, Version=,Culture=ne

Microsoft's Collaborative Application Markup Language (CAML) Loop

discovered an interesting error recently while working with Microsoft's Collaborative Application Markup Language (CAML) that, surprisingly, had received no ink. Partly what surprises me about this is that the error may require you to rewrite large sections of your code if you haven't previously considered this SharePoint limitation. I'll start with some context, but first of all the error is:

Integrating a Legacy Web Application in SharePoint

This month we will continue with the theme of deploying Microsoft's SharePoint as a company intranet by describing a method for integrating a legacy Web application inside a SharePoint site.

In many companies the intranet site is not just a home page with announcements. It houses Web applications used by many different departments. In last month's article, I built a page to search the employee table in Northwind (the sample database included in Microsoft's SQL Server). This month, I will move the Web pages used to add/remove records from the table into the SharePoint intranet.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

High-Performance .NET Application Development & Architecture

It has always been a goal of project architects to plan an effective strategy from the ground up in regards to an new application. All relevant factors are taken into consideration with respect to the application, from its design and layout to a functional website infrastructure. Pre-.NET strategies and design guidelines still effective now were developed with Microsoft's DNA (Distributed interNet Application) platform. This model successfully served the purpose of architecting N(any number of)-Tier (levels) applications. In its basic sense, as in most robust, distributed applications, you'll architect 3 main layers or Tiers: presentation, business rules and data access.

Application architecture in asp .net

Application Architecture is the most important process of developing a good application. Some people tends to jump into coding without any architecture laid. Later we see those people changing the architecture and finally the application had to be developed from the scratch with the correct architecture.

In this article I will describe some details about how you can improve the architecture of you application. This article is targeted to the beginner's audience.

Improving Application Performance in .Net

Application performance has always been a concern for Web Application developers. This article contains guidelines and tips for maximizing application performance in ASP.NET.

Logic behind N -Tier Application Development

In the arena of application development, developers all over the world use various programming languages, technical processes, and technical tools. While using number of technical & non technical elements the processes or methods become complex, for simplification of the application development process, developers use various techniques such as dividing the application architecture into layers or parts. In the professional & technical language this separation or division process is called N-Tier Application Development process, where "N" stands for number and "tire" stands for layers or parts.

How to create 3 tier application using LINQ

As you know that in 3 tier architecture there are three layers

User interface layer. (Is our Form in Windows application and .aspx page in Web application)
Data Access layer. (Which provides interface between Business logic layer and Database)
Business Logic layer.(Which stores your application logic)

Using Lightbox in an ASP.NET Application

The article describes Lightbox as, "... a simple, unobtrusive script used to overlay images on the current page." It delivers a nice, professional looking method for displaying images as overlays through the use of hyperlinks.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend