mvc

MVC Html.TextBox providing incorrect value?

Hi, Given a loop like this: <% for (int valuationIndex = 0; valuationIndex < Model.CollectiveInvestment.Funds.Count; valuationIndex++) { FundValuation allocation = Model.CollectiveInvestment.Funds[valuationIndex]; int deletedIndex = valuationIndex;// (Model.IsDeleted(allocation...

How do I generate a unit test project along with my new project in Visual Web Dev Express?

Taken from http://msdn.microsoft.com/en-us/library/dd410597(VS.100).aspx ... If you are using the Standard or Express editions of Visual Studio, the Create Unit Test Project dialog box is not displayed. Instead, the new MVC application project is generated without a test project. Does this mean it can't be done? If it can...

Pros and Cons of Listener/Observer approaches to notify Model changes

In any typical iPhone application, there will be model classes that are responsible for data loading/parsing. Upon completion of the data loading/parsing tasks, the affected controllers needed to be notified of the change in the model and update the view accordingly. There are several listener/observer approaches for this in iPhone appl...

do all java mvc based frameworks require you to wire up each and every file in a config file?

do all java mvc based frameworks require you to wire up each and every file in a config file? like in .net you can create generic routes that map to things like: controller/action/parameter I'm currently reading up on spring, but haven't reach the MVC part yet. ...

Ready-made Javascript library for modelling card games?

MVC 'architecture'. I would like a convenient way of specifying the rules of a card game including aspects such as hands or tricks, scoring, which cards from the deck or pack are used, and so on. Does anyone know of anything like this, preferably in Javascript? Thanks for any guidance. ...

Is having many render partial functions bad?

I am trying to design my render partial. within one render partial i have 30 other render partial functions. I am rendering one item at a time. for example, I am going to put these items in their separate renderpartial function: time username title avatar tags score user information -- each element has its separate render partial and s...

Is there any OOP way to secure this MVC web app design?

I'm writing a shopping cart application for a family member's online seed business. It's a fairly straight-forward workflow - users select what they want to order, type in their contact information, and the application generates an HTML E-Mail receipt and sends it to the contact address. Now, here's the rub - I've implemented the appli...

How to convert an existing ASP.NET project into MVC pattern?

I created a ASP.NET project which calls a DAL class I wrote, to retrieve data to display on the page, most of the heavy lifting is in the DAL class. As you can see, it pretty straightforward, although I do have some minor validation code in my aspx page. Question here is that: how can I convert this project into a MVC pattern? ...

asp mvc - what is the best way to dynamically add data controls

Scenario: I have the following structure; Group (parent) -> Item (child). A Group can have many items. both group and item only have one editable field (string) In other parent/child table data I have used a partial view to display both the parent and child data - with the child data being a standard MVC index (i.e. list of items wit...

Multiple models sent to a single view instance

My terminology is probably way off here but basically I'm trying to learn the ropes of ASP.NET MVC and so far so good (largely thanks to Phil Haack and Scott Hanselman's tutorials). One thing which I haven't seen addressed yet is the 'right' or most elegant way to pass multiple data models to a view. To help put the question in context, ...

presentModalViewController problem

Hello, I have a problem, using presentModalViewController to display a UIView. Within the Application I have a NavigationController with a list of Items. Touching a Cell calls the first ViewController, responsible for only showing a background picture. Within the viewDidLoad method I create another ViewController which has a UiScrollVi...

ASP.NET MVC Default URL View

I'm trying to set the Default URL of my MVC application to a view within an area of my application. The area is called "Common", the controller "Home" and the view "Index". I've tried setting the defaultUrl in the forms section of web.config to "~/Common/Home/Index" with no success. I've also tried mapping a new route in global.asax, ...

Autocomplete: Display data different from what is filled, and filling in multiple fields?

Hello, I'm using asp.NET MVC, and am looking at the JQuery autocomplete plugin for what I want to do. I need some extra functionality that I don't think it provides. I have a page with two text fields, First and Last name. Ideally, when someone begins typing into either, I would like autocomplete to display both the first and last name...

Best way to place data in the view (MVC)

In the framework I am working with, if I want to present data in a view I do this: <h1><?php echo $this->header ?></h1> Recently I discovered xTemplate and noticed it uses string placeholders, so the above code in a xTemplate would be: <h1>{HEADER}</h1> I always thought that a little php in the view was ok and was also faster than ...

HtmlHelper is null in Error.aspx master page

I have a custom Error.aspx page in my ASP.NET MVC application. The error page uses a master page (which in turn uses another master page), and in the master page there is a call to HtmlHelper: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Unsecure.Master" ... %> ... Html.RenderPartial("LogOnUserControl") My web.config is set ...

Is AJAX easier with ZendX_JQuery or with Zend_Dojo?

The context is that I don't want to use Zend MVC - controllers, helpers, decorators etc - that's overkill for what I am writing. I've scoured the jQuery site plugins section and these issues bother me most: I have to search a lot for plugins - it is tedious. I have to check dependencies with jQuery versions. Thankfully I decided to s...

MVC authentication - it's own model?

I have a social network-esque site with a nice User model that seems to be covering all my bases right now. I am reworking the code from spaghetti and want to find the best-practice solution for logging in / registering a user. Here are my options (I think): Create a separate Auth class (model?) that simply searches for a record of a ...

MVC - is it okay for business models to know each other?

Simple question: in MVC, is it okay for one model to interact with another? For example, with an Auth model...can it interact with the User model - or is there a better way to go about it? Should the middle man be the controller? ...

asp.net mvc strongly typed view model with multiselect

Hi, I would like to know how i can bind my form values to my strongly typed view from a MultiSelect box. Obviously when the form submits the multi-select box will submit a delittemered string of my values selected...what is the best way to convert this string of values back into a list of objects to attach to my model to be updated? p...

Asp.Net MVC Validation - dependent fields

I'm currently trying to work through MVC validation, and am coming up against some problems where a field is required depending on the value of another field. An example is below (that I haven't figured out yet) - If the PaymentMethod == "Cheque", then the ChequeName should be required, otherwise it can be let through. [Required(ErrorM...