Search Results

Search found 567 results on 23 pages for 'mvc2'.

Page 12/23 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Why are ASP.Net MVC2 area controller actions callable without including the area in the url path?

    - by Nathan Ridley
    I've just installed Visual Studio 2010 and have created a new MVC2 project so that I can learn about the changes and updates and have discovered an issue with areas that I'm not sure what to make of. I created a new EMPTY MVC2 project I right clicked the project and, from the context menu, added a new area called "Test" In the new test area, I added a controller called "Data". The code is: public class DataController : Controller { // // GET: /Test/Data/ public ActionResult Index() { Response.Write("Hi"); return new EmptyResult(); } } Now, I compile and call this address: http://localhost/mytest/test/data and get the output: Hi All good. Now I call this: http://localhost/mytest/data and get the same response! I thought routing was supposed to take care of this? Am I overlooking something? Or has the default project setup for MVC2 overlooked something?

    Read the article

  • How to make ASP.NET MVC2 project templates to show up in VWD2008 Express?

    - by Seh Hui 'Felix' Leong
    OK I'm completely stumped here: I have installed (and reinstalled) ASP.NET MVC2 installed several times and I still can't see the ASP.NET MVC2 project templates shown in Visual Web Developer 2008 Express. I had checked the default project directory templates and had verified that those templates are installed, for example these templates files are found C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\VWDExpress\ProjectTemplates\CSharp\Web\1033: EmptyMvcWebApplicationProjectTemplatev2.0.cs.zip MvcWebApplicationProjectTemplatev2.0.cs.zip Any idea of tracking what's the problem and fix it?

    Read the article

  • Where to find documentation/tutorials on ASP.NET MVC2?

    - by Richard77
    Hello, It looks like the final release for ASP.NET MVC 2 has been already around for 2 weeks. Unfortunately, I can't find documentation that's intended for MVC 2 exclusively. I've checked Amazon.com (no book yet on MVC2), ScottGu's Blog (only 2 short posts), ASP.NET/MVC website (they've only posted what are alreadi in the ScottGu's blog). Any idea where to find matter on MVC2? Thanks for helping.

    Read the article

  • Nested Model binding in ASP.NET MVC2. fields_for from rails equivalent

    - by dagda1
    Hi, I am looking for some examples of how to do model binding in ASP.NET MVC2 for COMPLEX objects. All the exmples I can find are of simple objects with no child collections or child objects. If I have an Expense object with a child ExpensePayment object. In rails, child objects are rendered with the HTML name attributes like this: expense[expense_payment][net] Rails uses fields_for to render child objects. How can I accomplish something similar in ASP.NET MVC2? Cheers Paul

    Read the article

  • Has anyone seen .NET 4 RC MVC2 RTM web apps hogging CPU on Win2008 R2?

    - by kim3er
    We have a number of .NET4 RC ASP.NET MVC2 RTM web applications running on a Windows 2008 R2 server. All behave very well except one that we regularly find running at 99% CPU. It is the most complex of the applications, but is not doing anything extraordinary. It relies on ASP.NET Cache quite heavily, but we have limited the amount of memory it is allowed to use. Does this sound like an issue with the environment? Rich

    Read the article

  • ASP.NET MVC 2 Hosting :: MVC2 deploy - Could not load file or assembly 'System.Web.MVC, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

    - by mbridge
    A new MVC 2 project worked on my local machine but when it was deployed to the test server it gave the error 'Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.' I have the full Visual Studio 2010 installed on my local machine but just the .NET 4 framework installed on the test servers. It seems the MVC assemblies do not come with .NET 4 framework itself so how to make MVC 2 work on the test servers? When I installed Visual Studio 2010 on my local machine it came with all the fruit included (.NET4 framework, MVC2 etc) so the System.Web.Mvc.dll can be found in my machine's GAC (C:\Windows\assembly). However, since there is no need to bloat the web servers only the plain old .NET4 framework has been installed on the test servers. This does NOT include the MVC assembly and that is why it cannot be found by the web application. You need this assembly to be on your web servers that you are deploying to but you want to avoid having to copy them into the GAC manually and doing all that gacutil mess or maybe you don't have access to your servers if they are hosted by provider. Solution You need to make the System.Web.Mvc assembly bin deployable... okay that doesn't sound easy but here is how to do it for the necessary MVC references: Simply right click the reference and select 'Properties' Then change 'Copy Local' to 'True': Note If your server has .NET 3.5 sp1 installed the new(ish) assemblies System.Web.Routing and System.Web.Abstractions will already be in the GAC. If you had previously deployed an MVC 1 application to a .NET 3.5 server you may remember having to deploy the other two assemblies too. Since MVC2 requires at least .NET 3.5 sp1 you will not need to worry about these assemblies, just System.Web.Mvc

    Read the article

  • Why can I not install ASPNET MVC2 from the Web Platform Installer? (Error: "requires VS2008 SP1", bu

    - by Cheeso
    I went to http://www.asp.net/mvc/ to try to install ASP.NET MVC. I didn't know, but MVC is now at version 2. There's a nifty thing called the Microsoft "Web Platform Installer" (WPI) which basically is a small installer-driver tool that presents a menu of things I might want to install, to do web things on Windows. On the menu are things like ASPNET MVC2, but also Drupal, PHP, Joomla, and a bunch of other things. From http://www.asp.net/mvc/, when I click on the link that says "Install MVC", it resolves to http://go.microsoft.com/fwlink/?LinkID=185037, which then pops up the WPI. But Then! I get an error dialog that reads "Installing ASPNET MVC2 requires VS2008 SP1". But I know that I have VS2008 SP1. What gives?

    Read the article

  • ASP.NET-MVC2 Preview 1: Are There Any Breaking Changes?

    - by Jim G.
    I was following Steven Sanderson's 'Pro ASP.NET MVC Framework' book. On page 132, in accordance with the author's recommendation, I downloaded the ASP.NET MVC Futures assembly, and added it to my MVC project. Then, without encouragement from the author, I downloaded, installed, and incorporated the ASP.NET MVC2 Preview 1 dlls into my project. Now, I can no longer load the website. That is, when I hit F5 in Visual Studio, I get this error. In retrospect, I think it was a really bad idea to assume that ASP.NET MVC2 Preview 1 would only be additive; but I'd like other people to weigh in. Has anyone noticed any breaking changes in ASP.NET MVC 2 Preview 1? Also - Has anyone noticed any changes that impact Castle Windsor? Also, please let me know if I should be mindful of IIS6 vs. IIS7 ramifications.

    Read the article

  • ASP.NET MVC2 Access-Control: How to do authorization dynamically?

    - by Shaharyar
    We're currently rewriting our organizations ASP.NET MVC application which has been written twice already. (Once MVC1, once MVC2). (Thank god it wasn't production ready and too mature back then). This time, anyhow, it's going to be the real deal because we'll be implementing more and more features as time passes and the testruns with MVC1 and MVC2 showed that we're ready to upscale. Until now we were using Controller and Action authorization with AuthorizeAttribute's. But that won't do it any longer because our views are supposed to show different results based on the logged in user. Use Case: Let's say you're a major of a city and you login to a federal managed software and you can only access and edit the citizens in your city. Where you are allowed to access those citizens via an entry in a specialized MajorHasRightsForCity table containing a MajorId and a CityId. What I thought of is something like this: Public ViewResult Edit(int cityId) { if(Access.UserCanEditCity(currentUser, cityId) { var currentCity = Db.Cities.Single(c => c.id == cityId); Return View(currentCity); } else { TempData["ErrorMessage"] = "Yo are not awesome enough to edit that shizzle!" Return View(); } The static class Access would do all kinds of checks and return either true or false from it's methods. This implies that I would need to change and edit all of my controllers every time I change something. (Which would be a pain, because all unit tests would need to be adjusted every time something changes..) Is doing something like that even allowed?

    Read the article

  • Best practice for structuring a new large ASP.NET MVC2 plus EF4 VS2010 solution?

    - by Nick
    Hi, we are building a new web application using Microsoft ASP.NET MVC2 and Entity Framework 4. Although I am sure there is not one right answer to my question, we are struggling to agree a VS2010 solution structure. The application will use SQL Server 2008 with a possible future Azure cloud version. We are using EF4 with T4 POCOs (model-first) and accessing a number of third-party web-services. We will also be connecting to a number of external messaging systems. UI is based on standard ASP.NET (MVC) with jQuery. In future we may deliver a Silverlight/WPF version - as well as mobile. So put simply, we start with a VS2010 blank solution - then what? I have suggested 4 folders Data (the EF edmx file etc), Domain (entities, repositories), Services (web-services access), Presentation (web ui etc). However under Presentation, creating the ASP.NET MVC2 project obviously creates it's own Models folder etc and it just doesn't seem to fit too well in this proposed structure. I'm also missing a business layer (or does this sit in the domain?). Again I am sure there is no one right way to do it, but I'd really appreciate your views on this. Thanks

    Read the article

  • Why user control with code behind file doesn't want to compile under MVC2?

    - by kyrisu
    I have user control in my MVC2 app placed in the Content folder (it's not supposed to be a view, just reusable part of the app). UserControl1.ascx looks like: <@ Control AutoEventWireup="true" Language="C#" CodeFile="~/Content/UserControl1.ascx.cs" Inherits="MVCDrill.Content.UserControl1" %> <div runat="server" id="mydiv"> <asp:LinkButton id="lb_text" runat="server"></asp:LinkButton> </div> UserControl1.ascx.cs looks like: using System; using System.Web; using System.Web.UI; namespace MVCDrill.Content { public class UserControl1 : UserControl { public string Text { get { return this.lb_text.Text; } set { this.lb_text.Text = value; } } } } I'm pretty sure this kind of stuff compiled under webforms but I'm getting compilation error: 'MVCDrill.Content.UserControl1' does not contain a definition for 'lb_text' and no extension method 'lb_text' accepting a first argument of type 'MVCDrill.Content.UserControl1' could be found (are you missing a using directive or an assembly reference?) Am I missing something? How to change it (what is the alternative) in MVC2 ? p.s. Intellisense sees lb_text with no problem. I've tried with different controls with the same outcome.

    Read the article

  • Can you point me to current examples using NHibernate in an ASP.NET MVC2 app?

    - by alphadogg
    Can anyone point me to any self-contained, complete, current reference materials/projects using NHibernate in an ASP.NET MVC2 application? I have looked at Sharp Architecture, but I am not sure I need the complexity in that project. I certainly don't know enough about it to know if it is over-engineered for my purposes. I would like to see more types of implementations to gauge the various ways people have skinned this cat.

    Read the article

  • MVC2 Data Annotation Buddy Classes Doesn't seem to work when Classes and EOM Model is in separate Project

    - by Danish Ali
    Dear All Iam new to MVC2 and having a little problem with implementing validation via buddy classes. Iam using Repository pattern with dependency injection. My Entity Object Model is in Data Layer Project and Buddy Classes are in Business Layer project and MVC 2 Project as a separate Presentation Layer Project. Can any one help me out with implementing Buddy Classes in this Architecture. Thanks and Regards Dani

    Read the article

  • Any samples of MVC2 + Silverlight 4? Visual Studio 2010 does not organize the files correctly.

    - by punkouter
    I create a SL4 Application and then I say I want to create a MVC site in addition. But instead of create a VIEW and putting showing the SL4 object there and creating a empty MVC type Default page... it just creates a SilverlightApplicationTestPage.aspx in the root! Does anyone know any small sample code anywhere that shows how to set up various .xap files within a MVC app. It should be simple. (I want to put the MVC2 app into Azure once I get this working)

    Read the article

  • ASP. NET MVC2: Where abouts do I set Current.User from a Session variable?

    - by Adam Brown
    Hi, I'm trying to get authentication and authorisation working in an ASP .NET MVC2 site. I've read loads of tutorials and some books which explain how you can use attributes to require authorisation (and membership in a role) like this: [Authorize(Roles="Admin")] public ActionResult Index() { return View(); } I've made classes that implement IIdentity and IPrincipal, I create a userPrincipal object once the user has successfully logged in and I add it to a session variable. When the user goes to another page I want it to set the HttpContext.Current.User to the object that I stored in the session, something like this: if (Session["User"] != null) { HttpContext.Current.User = Session["User"] as MyUser; } My question is: Where abouts do I put the code directly above? I tried Application_AuthenticateRequest but it tells me Session state is not available in this context. Many thanks.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >