I can understand what the error is saying - it can't compare a list. Not a problem, other than the fact that I don't know how to not have it compare a list when I want to page through a model with a list as a property.
My Model:
Event : IEvent
int Id
string Title
// Other stuff..
LazyList<EventDate> Dates // The "problem" prop...
Hi, using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In the navigation menu, I am trying add a class to the that the current page relates to (i.e., home page will add class="active" to the Home button). I'm trying to consider scalability and the fact that I don't want to change individual pages if the navigation chang...
I got this error using a new "ASP.NET MVC 2 Empty Web Application" project:
CS0012: The type
'System.Web.Routing.RouteValueDictionary'
is defined in an assembly that is not
referenced. You must add a reference
to assembly 'System.Web.Routing,
Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.
...
Is it possible to utilize MVC 2 from MonoDevelop 2.2 (using Mono 2.4)? If so - is it as simple as grabbing a reference to the new System.Web.Mvc or is there something else to consider?
I realize that any templating support in MonoDevelop may not be 100% there since it was built to utilize MVC v1 (at least as of MonoDevelop 2.2).
If any...
I have a model called 'Project' with a field called 'status'. If the user changes any data in the view, I need to change the status value. How do I check in the Controller to see if the model coming back from the view is dirty?
Thanks!
...
I'm working on a project using Visual Studio 2008 and have moved from the the MVC 2 Preview to RTM version. We would like to use model validation such as:
public class ViewModel
{
[Required(ErrorMessage="UserName is required.")]
[StringLength(10, ErrorMessage="UserName cannot be greater than 10 chars.")]
public string UserN...
If I use DisplayForModel in a strongly-typed ASP.NET MVC 2 View with an EntityObject model, then unwanted field labels are displayed:
EntityState
EntityKey
How can I control the output to hide these?
...
I am using ASP.NET MVC 2.
Html.DropDownListFor and Html.TextAreaFor automatically get red borders when the validation fails.
How to make the four borders of a TextBox (using Html.TextBoxFor) red when it fails validation?
For example, I have a TextBox that is required and when the user submits the form without specifying a value in the...
I get this error: A potentially dangerous Request.Path value was detected from the client (?). when this URI: http://www.site.com/%3f.
How can I write an integration tests around of all of this type of errors?
I want to test against all this erros:
A potentially dangerous Request.Path value was detected from the client
A potentially ...
I've gotten myself stuck on how to handle inheritance in my model when it comes to my controllers/views.
Basic Model:
public class Procedure : Entity
{
public Procedure() { }
public int Id { get; set; }
public DateTime ProcedureDate { get; set; }
public ProcedureType Type { get; set; }
}
public ProcedureA : Procedure
...
Ok, let me try to clearly explain what I'm attempting to accomplish here.
Basically, I have a site that is using a liberal dose of jquery to retrieve partialviews into a consolidated 'single view'. So far so good - it all works great and is very performant.
However, I would like to have the ability to 'flag' (using a button) any such ...
Hy,
i went from this page on internet http://studiostyles.info/schemes that have a particular rendering technique, the list grow when the page is rendered. Is there anyone that can explain me how it is possible?
Thanks in advance.
F.
...
I'm having a hard time finding information on what I expect to be a pretty straightforward scenario. I'm trying to unit test an Action on my ASP.NET Mvc 2 Controller that utilizes a custom input model w/ DataAnnotions. My testing framework is xUnit, as mentioned in the title.
Here is my custom Input Model:
public class EnterPasswor...
I've searched around a lot, and honed this problem down to this case:
I'm using the PRG pattern, pragmatically I'm using the same DTO for my post/get actions. It looks like when I have the dto with the data annotation attributes in the get action parameter list, the validation is always displaying errors, every time on initial page load....
Hi!
I have a problem regarding MVC Anti forgery token.
When I do my authentication I have pseudo code like this:
var user = userRepository.GetByEmail(email);
System.Threading.Thread.CurrentPrincipal = HttpContext.Current.User = user;
by doing so I'm able to get the current user in my code like this:
var user = HttpContext.Current.Use...
http:www.site1.com/?sid=555
I want to be able to have the sid parameter and value persist whether a form is posted or a link is clicked.
If the user navigates to a view that implements paging, then the other parameters in the querystring should be added after the sid.
http:www.site1.com/?sid=555&page=3
How can I accomplish this in As...
I set values for the Order property of the Display attribute in my model metadata.
[MetadataType(typeof(OccasionMetadata))]
public partial class Occasion
{
private class OccasionMetadata
{
[ScaffoldColumn(false)]
public object Id { get; set; }
[Required]
[Display(Name = "Title", Order = 0)]
...
In MVC2 template, I normally use this.ViewData.TemplateInfo.GetFullHtmlFieldId(fieldName)
to generate the id field of an html element. This has worked in most of the cases.
However this method does not actually return valid id field, it merely prefix fieldName with ViewData.TemplateInfo.HtmlFieldPrefix, this is causing problems for me w...
Some of the default DisplayTemplates and EditorTemplate views of ASP.NET-MVC2 are not compiled.
Why and what to do you do to get them fixed.
...
What if I have ChangePassword form with hidden ID field of the user.
BadPerson knows id of GoodPerson. He opens Change Password form with FireBug, changes his Id to GoodPerson's Id, so password changes for GoodPerson.
Of course I can create some server logic that will prevent this, but I think there should be some out of the box solut...