I am loving MVC 2. The whole thing just fits the web so well.
There is one piece of functionality, however, that I am unable to coax out of the Html.DisplayFor() function:
<@ Page Inherits="ViewPage<IEnumerable<Foo>>">
<% foreach(var item in Model) { %>
<%: Html.DisplayFor(item.BarBaz) %>
<% } %>
I need to be able to use the ...
Now that MVC has introduced HTML Encoding via
<%: blah %>
is there still value in using
<%= AntiXSS.HTMLEncode(blah) %>
instead?
For Example: My application will take all content in (including JavaScript) and store it in it's raw state in the database. I was planning on simply outputting everything using something like <%: m...
My organization currently delivers a web application primarily based on a SQL Server 2005/2008 back end, a framework of Java models/controllers, and ColdFusion-based views. We have decided to transition to a newer framework and after internal explorations and mini projects have narrowed the choice down to between Python and C#/.NET.
Le...
I am very new to MVC and am looking for the best way to handle access to the Enumerator of the following class when used as the type of a View:
public class TemplateCollection : IEnumerable<Template>
{
private IEnumerable<Template> templates;
public TemplateCollection()
{
LoadTemplates();
...
How do I get VS 2008 Professional Edition's Add New Project dialog box to show me the ASP.NET MVC 2 project type? It currently shows me only the MVC 1 project template (ASP.NET MVC Web Application).
I have both versions of MVC installed.
...
I have this code here where I retrieve an attachment from an Email Message that is on the Exchange Server using EWS
Attachment attachment = message.Attachments.Single(att => att.ContentId == Request.QueryString["cid"]);
attachment.Load();
FileAttachment fileAttachment = attachment as FileAttachment;
...
I would like to pass an interface to a method signature which takes Object as its parameter, so I wonder about this question
public Stream GetViewStream(string viewName, object model, ControllerContext context)
instead of object I shall like to pass an interface Imodel, without modifying the signature. Is there a base class for inter...
I'm keen to teach myself ASP.NET MVC 2 (coming from a heavy embedded or rich GUI background). If have found the nerddiner walk-through but it is still for ASP.NET MVC 1. The codeplex downloads have been updated to MVC 2 but the link for the PDF goes back to the MVC 1 book.
Is it even possible to follow the walk-through in MVC 2?
If s...
Hi there, in my Asp.net MVC2 app I have registered the following routes in the global.asax.cs:
routes.MapRoute(
"Search",
"Search/{action}/{category}/{query}/{page}",
new { controller = "Search", action = "Results", category = "All", page = 1 },
new { page = @"\d{1,8}" }
);
// URL: /Search
routes.MapRoute(
"S...
In my little app I've a strongly typed partial view (the Login Form) this is rendered within the Masterpage, this looks as follows:
<!-- Login Box -->
<div class="login">
<div class="login-bg clearingfix">
<% Html.RenderPartial("LoginViewControl", Model); %>
</div>
</di...
I'm building a site and doing all my tests on the built-in development server of Visual Studio. Things were working just fine but at some point my site stopped using cookies after logging in using forms. Junk was being placed in the URL string and cookies weren't being set. Session variables were being set but apparently those did not ho...
Hello,
im on the microsoft download center to download mvc2.
But here i see three links and i have doubts what is what i need:
http://www.microsoft.com/downloads/details.aspx?FamilyID=c9ba1fe1-3ba8-439a-9e21-def90a8615a9&displaylang=en#Requirements
release notes
MV2 for visual studio 2008
A test project of MVC2
From wich plac...
I am new to MVC and I am wondering how to do the following;
Using a foreach loop and a user control I am happily displaying a list of users from a database.
This page is an admin page, and the associated permissions for each user are displayed. I want to change this so that under each heading for each role there is a checkbox that determ...
I'm currently developing an ASP.NET MVC application with a ton of PK-FK relationships in the database. In the beginning of development, the team I WAS working with voted against my recommendation to use INTs for all PKs... they decided to use GUIDs.
Long story long... the team has split ways, and now I have control to change things... ...
The full story is I want to disable the submit button on a form's submission to prevent multiple submissions. One of the problems is the form is an ASP.Net MVC Ajax form - <% using (Ajax.BeginForm ... %> - so its javascript onSubmit event is already set and I therefore cannot do this during that event. Unless there's a way to add to the ...
Hi
I'm building an app that deals with customer queries, where I want to route the query through a decision tree showing appropriate views before taking some automated action against their query. Kind of like the game "20 questions"! Based on the answers at each stage, the path through the app will change.
I was thinking of using MVC, ...
I've created a view for adding/removing items for a list. I'm trying to handle adding/removing dynamically, but I'm unclear on how to get the proper template context when the list is empty.
The view is based on:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Service.Cms.ListItems;
namespace...
I have controller method in my MVC application that I am calling using the jQury $.post.... The call is executing correctly, processing and sending a valid result back to the view for rendering. If I alert the result everything is received on teh client as expected but the data is not rendered to the view.
The controller mehtod is as ...
I am working on an ASP.NET MVC application. I have implemented custom membership provider, principal and identity. In the custom provider I replace the HttpContext.Current.User in the ValidateUser() method as follows:
public sealed class CustomMembershipProvider : MembershipProvider {
...
public override bool ValidateUs...
I have setup my MVC project to use Fluent Validation and Castle Windsor and everything is working wonderfully. I am using a custom Validator Factory to take into account that I am also using Entity Framework and have to account for the dynamic proxies that get wrapped around my POCO classes. Here is my CastleWindsorValidatorFactory:
p...