mvccontrib

Refactoring a form in MVC2

I find myself pasting this code over and over on many views that deal with forms. Is there a simple approach to refactor the following markup from a view in MVC2? The only changing part is the route for the cancel link (LocalizedSaveButton and LocalizedCancelLink are helper methods I created). I tried extracting it to a PartialView but I...

Returning specific UserHostAddress using TestControllerBuilder

I am using MvcContrib and the TestControllerBuilder to write tests for my controller. I am writing the tests for my Error Handling Controller that looks like this: public JsonResult HttpError() { Exception ex = null; try { ex = (Exception)HttpContext.Application[Request.UserHostAddress.ToStr...

MVCContrib grid - sorting a custom column

Hello, Just started learning to use the grid so please excuse me for the possibly trivial question. How can I sort by a column that uses another table property? For ex. column.For(cust => cust.LinkedTable.someProperty).Sortable(true); definition results in a "Could not find a property called 'someProperty' on type MyProject.Models.Node...

MVCContrib PortableAreas can we override views in clients?

I have two mvc applications: say, apartment rental and boat rental. These are the "clients." I have an MVC contrib portable area project that contains our log in system. This is the "server." The UX designers insist that we need to have different markup on "forgot my password" for the apartment site. So one "client" will use the def...

MvcContrib Select Control does not highlight in red on ModelError

I would like the MvcContrib select control to be highlighted in red, but currently I can only show the error text. I currently populate security questions in the view: <%= this.Select(Html.NameFor(x => x.Question1).ToHtmlString()) .Options(Model.AllSecurityQuestions, x => x.Id, x => x.Question) .Selected(Mode...

Add An Anchor To RedirectToAction's Result?

I'm trying to create an extension method similar to MVCContrib's RedirectToAction method by creating a method that will take an #anchor argument and add it to the Url. I am familiar with this question but it's not strongly typed. It's also possible to add values to the query-string, but that won't work for an anchor. public static Redir...

Missing Documentation: MVCContrib UI-Testing

Is there any documentation or example how to use MvcContrib.TestHelper.Ui and WatinDriver? ...

MVCContrib Grid - how to add and delete rows with ajax ?

Hello, I'm wondering what's the best strategy to delete a row in MVCContrib generated grid. Consider this grid: Html.Grid(Model.Proc.Documents).Columns(column => { column.For(c => c.Name).Named("Title"); column.For(c => c.Author.Name).Named("Author"); column.For("Action").Action( delegate(DocumentDto doc) ...

MvcContrib Grid - Go to first page when sorting

Hello , i am using the MvcContrib grid for an mvc application. I have set up sorting and paging , but I have to make the grid to go the first page when the user sorts the grid . Any ideas on how doing that ? ...

ASP.MVC and mvccontrib fluent test with IOC

I am trying to use the fluent test helpers to test an AbstractRestfulFluentController public class CustomerController : AbstractRestfulFluentController { private readonly IService<Customer> _customerService; private readonly IService<CustomerAddress> _addressService; public CustomerController(IService<Customer> customerServ...

Why [PassparametersDuringRedirectAttribute] gets the value of an id from the session and disregard the one in the url?

I am using [PassparametersDuringRedirectAttribute] with an action in the controller. The action takes an id as parameter. After a redirect to another action that also takes an id I found a problem. The problem is that if I called the url for this action with the id in the url the action will disregard the url id and retrieve the id from ...

How do I test an ASP.NET MVC2 post action with validation when using MvcContrib TestHelper?

I'm attempting to write a unit tests for an ASP.NET MVC 2 post action that takes a view model as its sole parameter. The view model is decorated with validation attributes such as [Required]. I'd like to test two scenarios. The first scenario is when a valid set of data is passed in (ie, all required properties have values) and a redirec...

Strange problem Ajax enabled MVCContrib Grid pager

Hello, Let's explain the context: I have a person form inside a jquery dialog that has some tabs to group informations related to this person (Personal data, addresses, emails, position, etc.) One of the tab show the Person addresses through an ajax call to this controller action [HttpGet] public ActionResult GetAddresses( int id, int...

Multiproject areas in ASP.Net MVC 3

Does any one have any idea about multiproject area support in asp.net mvc 3? As it was degraded to future status in mvc 2. If it is still not included then should we look forward for ASP.Net MVC Portable Areas via MvcContrib. Can you share your expreriences? What are the recommended way for managing a large application? I read about MEF...

MVCContrib Pager not emitting my query string

Hello, How do I get my original query string appended to the end of the pager output? All I am getting now is this: http://localhost:4988/Assets/Browse/1?page=2&amp;Visible=false I need all the various name/value pairs from my query string appended onto the next/previous links. Also, what is “visible” used for in the above link? I d...

Issue with mvcContrib fluent route testing in asp.net mvc

I have an issue with testing routes using the MVCContrib Fluent route testing. The test fails yet the application recognises the routes. Let me explain.... I have the following routes in my register (shown in order) routes.MapRoute( "PurchaseUnitsPaged", "PurchaseUnits/Page{page}", new {...

Overriding the default 'No Data' Message in MVCContrib Grid

Is it possible to override the default 'There is no Data available' message in MVCContrib Grid with a custom message? ...

Html.EditorFor() -- editor template in portable area

I am trying to use a partial view editor template in my application using the Html.EditorFor method in my view. If the editor template is directly in the Views/Shared/EditorTemplates directory of my application, it works great. If the editor template in the Views/Shared/EditorTemplates directory of the portable area I am using in my ap...