In a view, I want to consume some Json produced by an action on another controller. I don't think I ought to be arbitrarily specifing the url for the resource because if I say something like "/Dealerships/GetDealerData" and if my application is a virtual directory at say "www.somesite.com/MyApplication", then my reference to that resourc...
I believe this question applies to any of the "For" Html helpers, but my specific problem is using CheckBoxFor...
I have a model that is of type IEnumerable, where rights is a simple POCO. This model is actually a property of a bigger model that I created an EditorTemplate for. Here is the bigger picture of my model:
public class big...
I'd like to have URLs that are even shorter than /{Controller}/{Action}/{Id}.
For example, I'd like {Controller}/{Id}, where {Id} is a string.
This would allow for simple paths, e.g. Users/Username, Pages/Pagename, News/Newsname. I like this better than requiring the /Details action in the URL (Users/Details/Username), which is less e...
I have the following classes in my Model:
public abstract class Entity : IEntity
{
[ScaffoldColumn(false)]
public int Id { get; set; }
[Required,StringLength(500)]
public string Name { get; set; }
}
and
public class Model : SortableEntity
{
[Required]
public ModelType Type { get; set; }
[ListRequired]
...
I'm trying to validate user input, in particular user passwords. I have some jQuery validation, but of course I also need to validate on the server side. Now my request comes in to the controller, which will hand it off to a UserService. Everything is loosely coupled, so the controller really doesn't know too much about the inner UserSer...
Was just wondering if this was normal behavior as I'm fairly new to ASP.NET MVC. When I monitor the site usage via procmon I see the following:
7:19:17.0053886 PM w3wp.exe 3992 QueryOpen C:\www\inetpub\ControllerName.mvc\ActionName PATH NOT FOUND
(This site is setup to run on IIS6/MVC2 - the reason for the .mvc extention)
This is ha...
Table Product
Product Id
Product Name
Table Supplier
SupplierId
ProductId
SupplierName
When I create a New Product, I want to have a textbox to enter a supplier as well on the same view. Is this a good practice? Since Product can have many Suppliers, I want to be able to add more Supplier records from the same view. How do I do that?
...
I want a list of different (derived) object types working with the Default Modelbinder in Asp.net MVC 2.
I have the following ViewModel:
public class ItemFormModel
{
[Required(ErrorMessage = "Required Field")]
public string Name { get; set; }
public string Description { get; set; }
[Scaffold...
When building code like this:
<script type="text/javascript" src="<%=ResolveUrl("~/js/js.js")%>"></script>
or
<input type="image" src="<%=ResolveUrl("~/img/submit.png")%>" />
Should I use Url.Content or ResolveUrl()? What's the difference?
...
Is there anything wrong with checking so many things in this unit test?:
ActualModel = ActualResult.AssertViewRendered() // check 1
.ForView("Index") // check 2
.WithViewData<List<Page>>(); // check 3
CollectionAssert.AreEqual(Expected, ActualModel); // check 4
...
Does anyone know if this has been released yet?
I went to asp.net and the Windows PI installs MVC 2 and it doesn't mention anything about RC's but then Scott Guthrie doesn't mention anything on his blog either.
...
Hello!
I have a localized application, and I am wondering if it is possible to have the DisplayName for a certain model property set from a Resource.
I'd like to do something like this:
public class MyModel {
[Required]
[DisplayName(Resources.Resources.labelForName)]
public string name{ get; set; }
}
But I can't to it, as the c...
I have a asp.net mvc site that references a couple of libraries. Recently I discovered that it is necessary to migrate those dlls to .net 4 (I mean compile them for .net 4). Can I run asp.net mvc 1 on .net 4. Migration to asp.net mvc 2 is postponed because of the removal of response.WriteSubstitution(...) method.
...
I'd like to improve my page by combining and minifying javascript and CSS files. Since MVCContrib already contains a project called IncludeHandling, I took a look at that which unfortunately left me with unanswered questions:
There is quite a set of interfaces and objects involved in the process. Now I'm using Ninject.Mvc, but it seems ...
Now that ASP.NET MVC 2 is out, I tried to install it on my development machine, which already has Visual Studio 2010 RC installed and I got this error message during installation
Component Microsoft ASP.NET MVC 2 has failed to install with the following error message:
"A different version of ASP.NET MVC 2 is already installed on yo...
There are several similar questions to this on stack overflow, but I couldn't find one that actually answered my question.
I am writing an asp.net mvc application which will need to have a front end sign up peice (home page, sign up page, account management, etc) and then allow each account to point their own domain to us and have it go...
I have a Consumer class and a BillableConsumer : Consumer class. When trying to do any operation on my "Consumers" set, I get the error message "Object mapping could not be found for Type with identity Models.BillableConsumer.
From the CSDL:
<EntityType Name="BillableConsumer" BaseType="Models.Consumer">
<Property Type="Stri...
I am new to ASP.NET MVC 2.
I do not understand why I am receiving this error. Is there something missing that i'm not referencing correctly.
I'm trying to create a simple jquery autocomplete online search textbox and view the details of the person that i select
using System;
using System.Collections.Generic;
using System.Linq;
using...
I am looking for best practices conforming to the MVC design pattern.
My Entities have the following relationship.
tblPortal PortalId PrortalName
tblPortalAlias AliasId PortalId HttpAlias
Each Portal can have many PortalAlias.
I want to Add a New Portal and then Add the associated PortalAlias.
I am confused on how I should structure ...
Hi
Recently i am working on migrating the ASP.NET Web application to MVC.
I am wondering if there is any equivalent of ASP:Timer control in ASP.NET MVC Framework. So that this Timer control can automatically check for a particular value from the Database once in every couple of Seconds(that we specify).
If there is no equivalent of Ti...