Suppose I have ViewModel like
public class AnotherViewModel
{
public string Name { get; set; }
}
public class MyViewModel
{
public string Name { get; set; }
public AnotherViewModel Child { get; set; }
public AnotherViewModel Child2 { get; set; }
}
In the view I can render a partial with
<% Html.RenderPartial("AnotherView...
Does anyone know how to sort the MVCContrib grid when using a complex object.
My grid is displaying a list of Person and I'm trying to sort on the Country property. The problem is that Country is a property an Address class which is a property of Person.
Person.Address.Country
<%Html.Grid(Model).Columns(column =>
{
colum...
I've been working a lot with asp.net web forms and one think that I like about the is the consistency with the generated markup e.g. if you create a composite control for a TextField you can control the generated markup in a single class like and don't break the SRP:
<form:textfield id="firstName" runat="server" required="true" label="F...
If I understand things correctly, to use MVC Contrib's FluentHtml in my Views, I need to change my Views to inherit from MvcContrib.FluentHtml.ModelViewPage instead of System.Web.Mvc.ViewPage.
Will I lose any functionality provided by System.Web.Mvc.ViewPage if I do that?
...
Situation: In some project management software written in asp.net I have a create project page (working fine). I need to add to this the ability to add tasks from a list of templates to this project pre-creation BUT the list of available tasks is dependent on some values sitting in the create form.
My abstract solution is this:
I h...
What I'm looking to do is set a Foreign Key object in an EF entity via FluentHtml. I have an entity of Foo with a reference to the object Bar via Foo.Bar. What I am trying to do is set the value of Bar in my view form. My models contains a collection of all Bars via Model.Bars. In my view I'm simply using <%= this.Select(m => m.Foo.Bar)....
I have something like this
public class Person
{
public Country {get; set;}
}
public class PersonInput
{
public ImNotSureWhatShouldIUseHere Country {get; set;}
}
there is a input builder for Enums in mvc contrib but it's not good for me because i retrieve the data from the DB and i save the Id of the selected element not the valu...
I'm attempting to use fluent html and the spark view engine in my asp.net mvc application.
I've assinged the proper base class, added the assemblies, and when i do this.TextBox("MyProperty") it works fine.
However I get the below exception when i attempt to use this.TextBox(m=>m.MyProperty).
Any idea what can be causing this?
Exception...
Today I spent a good three hours trying to convert the project MvcContrib.Samples.InputBuilders, included in MVC Contrib to make it work with Spark View Engine, but so far was unable to do so.
Does anybody have a clue why these two just won't get along?
Changes I've made
InputForm.spark:
<viewdata model="SampleInput" />
!{Html.InputF...
Here's my current view code:
<% Html.Grid((List<ColumnDefinition>)ViewData["Parameters"])
.Columns(column =>
{
column.For(c => c.ID);
column.For(c => c.Name);
}).Render();
%>
I'd like to attach an HTML "id" attribute to each "name" td tag as such:
<table class="grid">
<thead>
<tr>
<th>Id</th>
...
With Data Annotations for example, besides decorating members like this:
[Required(
ErrorMessage = "You must enter your first name."
)]
public int FirstName { get; set; }
I can also do it like this to accommodate multiple cultures:
[Required(
ErrorMessageResourceType = typeof(Resources.Customer),
ErrorMessageResourceName ...
In Eric Hexter's Input Builders, different templates use different strongly-typed models; for example String uses PropertyViewModel<object>, DateTime uses PropertyViewModel<DateTime>, Form uses PropertyViewModel[], and so forth. Spark View Engine doesn't seem to allow this, because all elements that compose the presentation (masters, vie...
I see several articles on the interwebs about MVCContrib's subcontroller feature, but I don't see anything on the codeplex site about it.
Has this feature been supplanted by something in MVC2?
Whats the best approach for rendering controls with their own data pipeline (submit to their own controller, display data from their own contr...
I'm using MvcContrib to do my Spring.Net ASP.Net MVC controller dependency injection.
My dependencies are not being injected into my CustomAttribute action filter.
How to I get my dependencies into it?
Say you have an ActionFilter that looks like so:
public class CustomAttribute : ActionFilterAttribute, ICustomAttribute
{
private IA...
I am trying to come up with the best solution for creating a hierarchical grid in my ASP.NET MVC project. First, I looked at jqGrid, and found it's "treeGrid" option which is exactly what I'm looking for. However, from what I can tell, jqGrid is not free, and my client is not interested in purchasing a license for it.
To get an idea o...
I'm getting an expected error with my route testing using MvcContrib's ShouldMapTo function. According to the results, everything is fine, but the helper throws an AssertionException with an unfortunately sparse message. I'm using MVC1 and the corresponding MvcContirb.
[Test]
public void ThisShouldNotErrorButItDoes()
{
"~/District/...
Is there a generic Html.Element?
I would like to be able to do this:
Html.Element<AccountController>("IFrame", "elementName", new { src = c => c.ChangePassword })
...
i see that the codeplex site has moved to asp.net mvc version 2 already.
http://mvccontrib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=37422
will this work with version 1 also? if not, where can you download a build against version 1?
...
I am trying to use MVCContrib InputBuilders but I am having trouble. I am also using S#arp architecture and spark. My spark view looks like this:
new.spark:
<viewdata model="NewUserViewModel" />
${Html.InputForm<NewUserViewModel>()}
My global.asax.cs contains:
protected void Application_Start() {
XmlConfigurator.Configure();...
I am attempting to use the PRG pattern in an asp.net mvc 2 rc application.
I found that the MVCContrib project has a custom action filter that will auto persist the parameters in TempData
In an action I have the following
return this.RedirectToAction(c => c.Requested(accountAnalysis));
however this is adding a querystring param to...