I'm starting a new project which must have a working prototype within 10 days. The project should be cutting edge and I'd love to use latest tech, especially EFv4.
But, also I like new MVC2 features like ForEdit and easier validation implementation (for Areas I don't care).
MVC2 RC is out for VS2008 and works on VS10Beta 2 too, but "too...
I have an ASPNET MVC 2 project. When I use
<%= Html.TextBoxFor(model => model.Login) %>
the TexBoxFor will render as
<input id="Login" name="Login" type="text" value="" />
Field in the model is
[Required(ErrorMessage = "")]
[DisplayName("Login")]
public string Login { get; set; }
Can I made id and name attribute with some pref...
I have problem with model binding in my ASP.NET MVC 2 RC application that uses NHibernate for data access. We are trying to build the application in a Ruby on Rails way and have a very simple architecture where the domain entities are used all the way from the database to the view.
The application has a couple of domain entities which c...
I am little bit confuse with Asp.net MVC Area.
When we talk about WebForms we say, for Administrative tasks, you must have an Admin folder to separate the admin task.
In MVC how i will treat my Admin tasks?
I will go for Admin Area or Admin Controllers,
Because if i will write controller for Admin tasks, each and every task will be w...
I have some partial actions that I render with the Asp.Net Futures RenderAction method. Some of these perform redirects after the forms in them have been processed.
Now that I upgraded to Asp.Net MVC 2 RC it gives me an error "Child actions are not allowed to perform redirect actions".
I checked out the source code and I found the line...
I use the latest version of ASP.Net MVC 2 RC.
My question is, how do I redirect from one action that's in the "Blog"-area to the index-action in the home-controller that exists in the "root" of my application (no area)?
I tried:
return RedirectToAction("index", "home");
but this redirects to /Blog/home, where Blog is the name of my ...
Im testing out the new MVC2 framework, and there I also have tried out the new areas functionality.
Im following this example:
Walkthrough: Creating an ASP.NET MVC Areas Application Using Multiple Projects
Everything builds and runs okay locally, but when I try to commit to my repository and the use the build automation engine Team Ci...
Will I get the advantage of the new Strongly Typed Html Helpers with asp.net MVC 2 if were to use the spark engine for rendering?
...
In my app I have a criteria builder section that's built using jquery and is pitched back to the controller in a form post and picked up as IList by the model binder as suggested in Phil's post here: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx
A really simple way that I'm persisting the criteria across posts is re...
Today (15th Jan 2010) Scott blogged about the ASP.NET MVC2 model-validation
http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx
Anyone knows how can someone add validation rules at runtime programmatically ?
"Programmatic Registration" is a similar functionality supported by ValidationAspects
// regi...
I'm trying to implement MVC 2 RC version, the latest release of ASP.Net MVC and it can't do a simple Controller.UpdateModel(object) without throwing this exception:
The model of type '[Insert namespace of object being updated here]' could not be updated.
InvalidOperationException
Here's the stack trace:
at System.Web.Mvc.Controller.U...
By picking MVC for developing our new site, I find myself in the midst of "best practices" being developed around me in apparent real time. Two weeks ago, NerdDinner was my guide but with the development of MVC 2, even it seems outdated. It's an thrilling experience and I feel privileged to be in close contact with intelligent programmer...
I need to do with HtmlHelper in Controller, so how i create it in Controller (asp.net mvc 2.0)?
...
How can I setup multiple projects using areas in asp.net mvc 2?
...
I use this code to create my controller:
public override IController CreateController(RequestContext requestContext, string controllerName) {
try {
Type controllerType = null;
var baseControllerType = typeof(DashboardController<>);
var item = _repository.GetByUrlSegment(requestContext.Rou...
Context =>
${Html.CheckBoxFor(x => x.Foos[i].Checked)}
${Html.LabelFor(x => x.Foos[i].Checked)}
Problem is - i can't provide label text based on Foo.Name.
Is there out of the box method of how to modify metadata, passing in lambda x=>x.Name to change it?
Is creating another HmtlHelper extension method
LabelFor(this htmlhelper, [...
public class Foo { public bool Checked {get;set;}}
View:
<viewdata model="Foo[] fooList" />
<for each="var f in fooList">
${Html.CheckBoxFor(x=>x[fIndex].Checked)}
</for>
Will output:
<input id="Checked" name="Checked" type="checkbox" value="true" />
<input name="Checked" type="hidden" value="false" />
<input id="Checked" name...
By default the web.config file for MVC project have the following element:
<handlers>
<remove name="MvcHttpHandler"/>
<add name="MvcHttpHandler" preCondition="integratedMode"
verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler"/>
</handlers>
My problem is that my site returns 404.14, after knocking out all the usual ...
I am part of a development team implementing a large application. There are several layers to the application, and we'd like to make the organization of files as easy to maintain as possible, but also follow best practice.
Here is an example of how this is laid out based on MVC convention.
UIProject
- Controllers
- HomeController.cs...
Is it possible to set route priority in asp.net mvc 2 using arearegistration? I have a catch all {*pagePath} route which I want to set the lowest priority on.
...