asp.net-mvc

Missing MVC templates in existing web project

In an existing VS2008 SP1 web project I'm introducing an MVC page. I was able to manually create a view and get it working just fine but I'm unable to get the "Add View" and "Add Controller" to work from the Solutions Explorer. Also, the MVC templates don't show up when I try and Add a New Item. I know my VS2008 is setup properly becaus...

Is there a way to trigger a server event with jQuery or ASP.NET MVC?

Hi everyone! I have this situation: I have a page where I have a list of events of a day. And these events can be changed theirs status to 'Confirmed' or 'Cancelled'. But, when I, for instance, click on 'Confirmed', this status is saved on SQL Server and this status is shown 'Confirmed'. But, if another person has this same page opene...

ASP.NET MVC : Changing model's properties on postback

Hi, I've been playing with ASP.NET MVC and ran into something I can't figure out. Suppose I have an object like this : public class TestObject { public string Name { get; set; } public int Age { get; set; } } And a view page (Create.aspx) like this : <form action="/Create" method="post"> <p> <%=Html.TextBox("N...

MVC Best Practices | Do you build your links into the Url Helper?

Just read a post about MVC best practices. Couple parts of the post described building helper methods to link to actions on the controllers. Here's a clip: 1) Create Extension methods of UrlHelper to generate your url from Route Avoid passing the controller, action or route name as string, create extension methods of UrlHe...

Automate deployment of asp.net mvc site

Currently I build my websites on my machine, deploy them to a test machine to see if they still work there and then have to request the sysadmin to deploy them to the qa/production servers. Time after time that what should be my moment of pride is killed by some deployment procedure that was misunderstood, forgotten or not documented. Cu...

Model Binding within a Model Binder

Firstly, bear with me here. I have a custom model binder which is successfully mapping form data to a custom object. Within this model binder it also maps form items to different custom object. What I feel I should be able to do is create a separate model binder to take care of this second mapping. This is a simplified version. Custom o...

ASP.NET MVC – Set Selected Value of Cascading Drop-Down

I'm working on an ASP.NET MVC application and using NHibernate. I’m working on a cascading drop-down and have used Method 1 in the following website: link text Everything is working correctly, I just wondered if it was possible to set the cascading drop-down to a value stored in a database? For example the list would be blank on a cre...

Conditionals in Views

I am fairly new to ASP MVC and was wondering what is the best way to handle conditional statements in your views? I am sure there isn't a one size fits all approach, but for simple checks is it wise to have If-Then-Else statements littering the view? For example, say I have a list and wish to set the class on one of the list items if on...

how to override the "A value is required." while validating a datetime format in asp.net mvc view?

I am checking a datetime field in mvc view for datetime format like this: If contactToValidate.LastUpdated = Nothing OrElse Not IsDate(contactToValidate.LastUpdated) OrElse CType(contactToValidate.LastUpdated, DateTime) = DateTime.MinValue Then _validationDictionary.AddError("AddErrorValue", "Date Format is not Corr...

Tweaking asp.net mvc

I really love the "one model in - one model out" idea of Fubu MVC. A controller would look something like this public class MyController { public OutputModel MyAction(InputModel inputModel) { //.. } } and the service locator would automagically fill in all the required dependencies in the co...

ASP.NET MVC Best Practices, Tips and Tricks

Please, share your ideas which could serve as best practices or guidelines for creating ASP.NET MVC web applications. These ideas and/or coding samples should be relevant to ASP.NET MVC application creation itself and not to TDD or similar practices. Other resources: ASP.NET MVC Best Practices (Part 1) by Kazi Manzur Rashid ASP.NET MV...

Can Standard .NET CMS systems be made to work with ASP.NET MVC

Has anyone successfully used a CMS developed for standard ASP.NET with ASP.NET MVC? I currently use Immediacy CMS and it seems to be quite tightly coupled with standard ASP.NET, but I'd really like to start using ASP.NET MVC. Are there any CMS systems out there directed at MVC? How could I persuade my employer to move to ASP.NET MVC?...

ASP NET MVC Server Response to a basic ajax request

We have to make an ASP.NET MVC or ASP.NET application for basic ajax navigation in Customer.html of Notrhwind.mdb. We have this 3 things: A pure HTML/Javascript form having HTML input text tags, one for each field of Customers table. We have also 2 navigation buttons: NextRecord and PrevRecord having at OnClick() event : clientGetReco...

Short/quick explanation of .net mvc

Hi, What would be the shortest explanation for .net mvc (for a manager to understand at a high level, how it works, benefits etc). ...

how to check null value of Integer type field in ASP.NET MVC view?

Hi, I have integer type field in database which is having property "Not Null". when i create a view & do a validation, if i left that field blank, it will consider it as 0 so i can not compare it with 0 because if someone insert a value 0 then it will be considered as error! one another problem is that i am using Model error as descri...

MVC Navigation Tabs

OK, I am now wondering how to handle navigation tabs with ASP.NET MVC. Giving an example, suppose you have the tabs like you have here at stackoverflow. So, Questions, Tags, Users, etc. Now lets say you have a "sub tab" under this main one. So there were for example View and Add tabs displayed once you had selected the main Questions t...

Lightweight .Net CMS Library

I am looking for a lightweight CMS Library for a .net MVC application. I don't need any frontend management, just a library that can store and retrieve pieces of content. I plan on writing the frontend myself. The most complex thing I can see myself needing to store is a set of news posts. Aside from this I need to be able to store sets ...

Child records not posting on ASP.NET MVC form

I have two tables, Author and Book, where an author can have many books. I've got an edit view set up as "System.Web.Mvc.ViewPage(of MyDatabase.Author)". The form is set up to show the Author and all his books, with the ability to edit book information: <% Using Html.BeginForm()%> <%=Model.author_name%> <br/> <% For Each item In Model.B...

asp.net MVC

Hi, im wondering if is possible to return a serialized AMF object in a control action in ASP.net MVC anyone as tried this before? thanks in advance. ...

ASP.NET MVC passing strongly typed data to master page

Duplicate Passing data to Master Page in ASP.NET MVC Should an ASP.NET masterpage get its data from the view ? I have been following this method for passing common data to the site.master. However, this does require specific casting of the ViewData and I don't like using string identifiers everywhere. Is this the best way to d...