asp.net-mvc-2

Can't run ASP.NET MVC 2 web app on IIS 7.5

I'm trying to run an ASP.NET MVC 2 web application under IIS on Windows 7, but I get a 403.14 error. Here are the steps to reproduce: Open Visual Studio 2010 Create a new ASP.NET MVC 2 project called MvcApplication1 Shift+F5 to run the app. You should see http://localhost:{random_port}/ and the page will render correctly. Click on MvcA...

How to create stackoverflow's post voting like jquery/ajax function?

Can I use Jquery to call an action and then change the image when it success, just like stackoverflow's post voting function? In my view, I'm using the following code, but I don't want to refresh the browser. Can anyone provide some code about this for me? Many thanks. <%if (!item.IsPrinted) { %> <%=Html.ImageLink("~/Content/imag...

Why is my asp:Substitution control suddenly not working in ASP.NET 4.0?

I just upgraded my site from ASP.NET 3.5 to 4.0. I've been working through some breaking changes and there were more than I expected. One I can't figure out, however, is why my <asp:Substitution /> control suddenly stopped working like it should. It's supposed to ignore the output cache settings of the parent page and update upon ev...

how do i "View in browser" a mvc 2 app?

This is probably a pretty simple question, but I don't see how to view in browser like I would for a traditional asp.net application. ...

Cannot create MVC project in VS2010

After installing the official VisualStudio 2010 (had installed and uninstalled RC before) I cannot create MVC projects. When I try to create a new "MvcWebApplicationProjectTemplate.cs" project, I got the following error message: Reinstalling MVC 2.0 didn't helped :( ...

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

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...

Create menu dynamically based on user's role

How do I create a menu in a ASP.NET MVC2 Master Page, dynamically based on the current user's "role"? ...

How to get interpolated message in NHibernate.Validator

Hi! I'm trying to integrate NHibernate.Validator with ASP.NET MVC client side validations, and the only problem I found is that I simply can't convert the non-interpolated message to a human-readable one. I thought this would be an easy task, but turned out to be the hardest part of the client-side validation. The main problem is that b...

Bookmarkabale ajax calls with MVC routing

I have a page with a menu that uses JQuery AJAX calls to populate the page with. To reflect any changes I update the URL with a #... instead of ?... or /... So an URL that originally reads : htpp://localhost/pages/index/id=1 would look like : http://localhost/#pages/index/id=1. If a user bookmarks this, and later comes back to the page, ...

Asp.Net MVC 2 Client validation implementation for Enterprise Library Validation Block

Hello to everybody. I've found a very good article about how to use EntLib Validation Block for server validation in MVC 2. But as there pointed out The current design of EntLib’s Validation Application Block uses the Composite pattern; that is, when we ask for validation for an object, it returns back a single validator object that...

Silverlight, Grids, MVC, HTTP Post

I'm trying to create an editable grid using Asp.Net MVC 2 and Silverlight (specifically a grid that displays info from a db and allows users to update that info). So far I've managed to put a silverlight grid on an a view, using this technique However I have no way of getting the updated data from the silver light grid. Is there anyway...

MVC + Extjs + IIS6 + Wildcard Mapping = Post Form resulting in 302 object moved

Everything seems to work fine until i want to submit the form and update the database. Wildcard mapping works on requests like "/navigation/edit/1", but when i submit the form as: var ajaxPost = function(Url, Params) { Ext.Ajax.request({ url: Url, params: Params, method: 'POST', a...

How do link the first level like localhost/About and localhost/Faq.

I make Views/About/Index.aspx and Views/Faq/Index.aspx + Controllers/AboutController.cs and Controllers/FaqController.cs controllers for these purposes. I want to have one controller Controllers/DefaultController.cs + Views/About.aspx and Views/Faq.aspx in the root, for example. How to set it up? ...

ActionLink in Asp.Net Mvc 2 does not reidrect

I have the following default and only route: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); In my Site.Master I have the following: <%= Html.ActionLink("Profile", "Details", "Use...

MVC on Server 2008 R2 - How?

I have a new WIndows Server 2008 R2 x64 DataCentre with Framework 3.5 SP1 and Framework 4 installed. When I install my MVC application (VS 2008 MVC 2.0 using a Web Setup project installer) and browse to the application I get an error that System.Web.Mvc cannot be found. If I copy the relevant DLLs (System.Web.Mvc etc)into the bin directo...

How to combine mvc2 client side validation with other client side validation?

I have a page using mvc2 with client side validation. The client side validation is provided by Microsoft Ajax mvc validation script. This does very well to validate all fields that are related to the model. I also have fields that are never sent to the server such as the confirm password value, and the accept agreement. For these fie...

How to include related Entities using dynamic queries

I am taking the values from a search form in my application to build a dynamic query: string queryString = @"SELECT VALUE USERS FROM ProjectDBEntities.Users AS Users WHERE "; There are two tables in the database, Users and Photo, table Photo has a column UserId that links to the Users table. A one to many relationship exists between ...

MVC Multiple submit buttons on a array of objects

Hi, I've got a list of objects in an MVC view, each with a set of submit buttons - Move up, Move down and Remove. Using the answer from this question, I can get the button clicked - but I need to know which item it would be operating on. The problem comes from the fact the input's value attribute is passed back, I need more informatio...

MVC Site - Ensuring the default entry view is always correct

I have a MVC site with AD authorization. This is all working fine. I publish the site to the webserver and call the site directly (http://intranet). If I have not logged in for a while (I have an authorised cookie with a 30 minute TTL), I am prompted to log-in and if successful I am redirected to the homeController's index view. This...

Asp.Net MVC2 Clientside Validation and duplicate ID's problem

I'm using MVC2 with VS2010 I have a view that has two partial views in it: "Login" and "Register" both partial views contains the Email address field i use the following in both partial views: <%: Html.TextBoxFor(model => model.EmailAddress ) %><br /><%: Html.ValidationMessageFor(model => model.EmailAddress) %> if i use both partial...