mvccontrib

Does ASP.NET MVC RC has a strongly typed RedirectToAction method already?

Since I have decided to let RC go while staying with Beta for now, I have no way of knowing whether there has been some progress in this area. Who has tried it, are there strongly typed RedirectToAction and maybe ActionLink in RC? (I know there is some extra stuff in Futures assembly, but the question really refers to the main build). ...

Use MVCContrib grid for editing

I just started using the MVCContrib grid in a test project. I'm having a difficult time finding information on how to use it for edit/update/delete. Can anyone point me to information on how to put a row into edit mode, or if there isn't such a thing for that grid, discuss a best practice for editing list data in MVC. ...

mvccontrib grid default sort order

Anyone know how to set the default sort order for the mvccontrib grid? ...

Using MVCContrib's WindsorControllerFactory with new Windsor Castle 2.0

I'm trying to use WindsorControllerFactory (the latest 1.0.0.916 version) together with the new Windsor Castle 2.0 (again, the latest version). But I'm getting the Could not load file or assembly 'Castle.Windsor, Version=1.0.3.0... error when starting the Web application. Anyway, during writing of this question I managed to pers...

MasterPage/ContentPage with NVelocity and ASP.NET MVC?

I am a big fan of NVelocity. I think its terse syntax is a huge boon, and helps keep my views simple and effective. I have begun using the NVelocity view engine from the Mvc Contrib project for ASP.NET MVC, along with the Castle NVelocity .vm syntax highlighter. While I love what NVelocity brings to the table, I am really missing one f...

How do I get intellisense working with Spark and FluentHtml?

I have Spark view engine registered with my MVC app and it works great :-) I have a problem however getting FluentHtml extension method intellisense working on my views. I was wondering if anyone else has had this problem? This code works: <%= this.TextBox(x => x.Name) %> But I dont get intellisense? I have intellisense working for ev...

Convert C# to VB.Net - Using MVCContrib Blockrenderer to render a partial view to a string

I need to render a partialview to a string, and I am trying to convert a C# example to VB.Net, as I am stuck with that for this project. This is causing me a headache from these two problems: ObjectViewData - I can't figure out what that is RenderPartial is a sub, but seems to be used as a function - I don' get it I reference the MV...

Unit testing MVC routes that POST

I have 2 routes registered as follows: routes.MapRoute("GetAnEmail", "{controller}", new { controller = "Home", action = "GetAnEmail" }, new { httpMethod = new HttpMethodConstraint("POST") }) routes.MapRoute("Home", "{controller}/{action}", new { controller = "Home", action = "Index" }) I have a valid unit test for the Home controller...

How do you use the MVCContrib Grid control?

I'm trying to use the GRID control in the MVCContrib library with my controller. The paging control for their Grid seems to have a big limitation, it only outputs a URL as MyPage.aspx?page=2. So when I press NEXT PAGE on the control is spits out "MyPage.aspx?page=2" My control looks like this: public ActionResult Index(int? page)...

Validation Message not showing after Redirect (Using ModelStateToTempData attribute)

I have a problem with validation messages not showing after a redirect, even when Im using MVCConrib's ModelStateToTempData. Am I overlooking something fundamental? [ModelStateToTempData] public class AccountController : BaseController { public ActionResult LogOn(string email, string password, string returnUrl) { if (!Va...

Create select list with first option text with mvccontrib?

Trying to create a select list with a first option text set to an empty string. As a data source I have a List of a GenericKeyValue class with properties "Key" & "Value". My current code is as follows. <%= this.Select(x => x.State).Options(ViewData[Constants.StateCountry.STATES] as IList<GenericKeyValue>, "Value", "K...

Test ASP.NET MVC routes using MVC Contrib

I'm trying to set up Route mapping tests using MVC Contrib as described in Test ASP.NET MVC routes using MVC Contrib The tests compile and execute, but they always fail with the message "The URL did not match any route." I set up another test to try to get an idea of what the problem is: Public Sub TestIndexRoute() Dim ro...

MVCContrib grid and posting back with model binder

The contents of my MVCContrib grid come from the Model on a strongly typed View. When a post is made, the contents of the grid are not in the model object when it returns to the controller. I can see that this is because the grid renders as just a table with text in cells. Is there something I can do so that when the post occurs, the li...

Using Request.Files.Count with TestControllerBuilder from MvcContrib?

I have a controller action in ASP.NET MVC that handles uploaded files. However, it seems there is no way to call Request.Files.Count while using MvcContrib's TestControllerBuilder. I know I can work around this by abstracting Request.Files. My questions are: Is it indeed the case that there is no direct way to call Request.Files.Count...

ASP.NET MVC - Returning data as HTML or XML

When requesting http://someserver.com/user/btyndall I'd like to return HTML When requesting http://someserver.com/user/btyndall?format=xml I'd like to return XML representation of my model I've downloaded MvcContrib. (I can't believe XmlResult is not a part of the core framework) What is the proper way to handle the request in the cont...

ASP.NET MVC - Html.ActionLink<T>(expression)

Is something like Url.Action<TController>(...) or Html.ActionLink<TController>(...) in MvcContrib? I see the FluentHtml stuff for forms, but I don't see the same concept applied to urls. This post on CodePlex said it was added, but I don't see it in the source anywhere. Any help would be great. Edit: Also, I have read this, but wo...

How to do pagination and filtering in MVC applications

I am having the same problem as this post but the answer does not work.... No overload for method 'Pager' takes '4' arguments Am I using old MVCContrib or the answer is deprecated? my code looks like this: in controller public ActionResult Index(int? clubid,int? page) { List<aspnet_Users> memberList = new List<asp...

Does MVC Contrib fulfill its promise of increasing productivity in ASP.NET MVC

I am knee deep in starting a new ASP.NET MVC project. Several tutorials have recommended the use of MVC Contrib. I wanted to get the opinion of the Stack Overflow community if it fulfilled its promise of increasing productivity with ASP.NET MVC. Basically are the benefits of MVC Contrib worth adding another leaky abstraction to my applic...

How to add a custom column to a MvcContrib Grid ?

I don't find a method to add a custom column in a MvcContrib Grid. With the old version you could do : column.For("Edit").Do(p => { %> <td> <a href="/People/Edit/<%= p.Id %>">Edit</a> </td> %>}); But with the latest version, the Do() method disappears... So now which method use ? ...

MvcContrib GridModel : Is it possible to do ActionSyntax in a GridModel

I have a code in my aspx file which uses ActionSyntax, and i want to use a GridModel instead, but i don't know how to do that. Here is a sample of my aspx file : <% Html.Grid(ViewData.Model).Columns(column => { column.For(x => x.Id).Named("N° de contrat"); column.For(x => x.SubscriptionDate).Format("{0:d}").Named("Date de souscri...