mvccontrib

Troubleshooting “The resource cannot be found.” Error

妖精的绣舞 提交于 2019-12-09 01:17:09
问题 I have an MVC 3 App with a few Areas built into it, one of the areas is my Admin section of my site. Everything was working just fine. I wanted to try MvcContrib Portable Areas to make my app more modular, so I installed MvcContrib and after some trial and error I got a couple Portable areas up and running. Then I decided to move my Admin area up into a portable area, so i created the new project and stubbed out my Admin portable area. I had to rename my local Admin Area so that it would not

MVC4 and MVCContrib

旧时模样 提交于 2019-12-08 16:15:00
问题 Does MVCContrib currently support MVC4? I am having a first look at switching a project from MVC2 to MVC4 and having some issues with Portable Areas. 回答1: In case anyone else comes across this post, you could try these: http://nuget.org/packages/StudioDonder.MvcContrib.Mvc4/ http://nuget.org/packages/StudioDonder.MvcContrib.Mvc4.TestHelper/ etc. with the source here: http://mvccontrib.codeplex.com/SourceControl/network/forks/ErikSchierboom/mvccontribmvc4 For each, they say: Note: this is a

MVCContrib Portable Area No Intellisense for ViewPage<T>

ぃ、小莉子 提交于 2019-12-08 09:36:55
问题 I am trying out portable areas using MVCContrib. In general these work well and it seems to be a good way to share controllers\views between web projects. The only problem that I'm having is that Intellisense (specifically, for the HtmlHelper) is not working in the view for strongly typed views i.e. ViewPage. The intellisense does work however when the view is a plain 'ol System.Web.Mvc.ViewPage A similar questions has been asked here: MvcContrib Portable Areas View Intellisense? But these

MVC contrib pager

十年热恋 提交于 2019-12-07 23:03:49
问题 I am using it like this: <%= Html.Pager((IPagination)Model) %> Is there are simple way to change the rendered url. I had a look for more documentation but couldn't find much. 回答1: What exactly do you want to change? This is how I change the URL: Html.Pager(Model.AssetsPagedList) .First("First") .Last("Last") .Next("Next") .Previous("Previous") .Link(currentPage => Url.Action("Browse", new { page = currentPage, searchTerm = Model.SearchModel.SearchTerm, excludedWords = Model.SearchModel

MvcContrib Grid Sorting

China☆狼群 提交于 2019-12-06 10:08:55
问题 Am testing out MvcContrib's grid for sorting. Am using LightSpeed as my ORM Problem: getting compile error on: listOfRfidTags = ... The type arguments for method 'System.Linq.Enumerable.OrderBy(System.Collections.Generic.IEnumerable, System.Func, System.Collections.Generic.IComparer)' cannot be inferred from the usage. Try specifying the type arguments explicitly. public ActionResult Index(GridSortOptions sort) { IEnumerable<RfidTag> listOfRfidTags = uow.RfidTags; if(sort.Column != null) {

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

无人久伴 提交于 2019-12-06 04:43:20
问题 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) { const string cbxFrmt = "<td><strong><a href=\"#\" onclick=\"DocDetails({0})\">View details</a></strong> | " + "<strong><a href=\"#\" onclick=\"RemoveDoc({1})\">Delete</a></strong>" + "</td>";

Add An Anchor To RedirectToAction's Result?

元气小坏坏 提交于 2019-12-06 00:18:23
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 RedirectToRouteResult RedirectToAction<T>(this Controller controller, Expression<Action<T>> action, string anchor) where T : Controller { var result = new RedirectToRouteResult<T>(action); // how can I add the #anchor to the result's url? return result; } 来源: https:/

Overriding the default 'No Data' Message in MVCContrib Grid

自古美人都是妖i 提交于 2019-12-05 22:52:57
Is it possible to override the default 'There is no Data available' message in MVCContrib Grid with a custom message? <%= Html.Grid<SomeModelType>(Model) .Empty("Some custom message") ... %> 来源: https://stackoverflow.com/questions/3986528/overriding-the-default-no-data-message-in-mvccontrib-grid

Integration testing an MVC application without the pain of UI automation

喜你入骨 提交于 2019-12-05 02:26:03
问题 I'm starting development on a new MVC application that will be largely written using TDD. I'd like to add some integration tests to ensure that the fully wired application (I'm using StructureMap for IOC, NHibernate for persistence) works as expected. While I intend to write a few functional smoke tests with Selenium, for maintainability reasons, I'd rather do my most of integration testing by directly calling actions on my controllers using good old C#. There is surprisingly little guidance

Html.Grid right align data in column

空扰寡人 提交于 2019-12-05 01:28:57
问题 In an Html.Grid, how can we ensure that data in the column (e.g. currency amounts) gets right aligned? Thanks. 回答1: You mean in the MvcContrib Grid? You could use something like: column.For(x => x.Amount).Attributes(style => "text-align:right"); or more tidily you could set a class: column.For(x => x.Amount).Attributes(@class => "right-align"); and set an appropriate style rule on that class. 回答2: Here's what worked for me. Within the grids htmlAttributes assign the resulting table an id. In