mvc

Does Anyone Still Prefer N-Tier Architecture After Having *Shipped* an MVC Application?

Other SO threads have asked people if they prefer N-Tier or MVC architecture. I'm not looking to continue that debate on this thread. I'm looking for something more specific. My Question: Does Anyone Still Prefer N-Tier Architecture After Having Shipped an MVC Application? Reason for My Question: Before I shipped an MVC web ap...

ASP.NET MVC Dropdownlist retain the selected value in the browser after post

I build a drop down list in my aspx page as following <%= Html.DropDownList("SelectedRole", new SelectList((IEnumerable)Model.roles, "RoleId", "RoleName", Model.SelectedRole), "")%> it works fine for first Get and the first default value is selected; then I select item from the drop down list and submit the form. the controller bind ...

Handling snippets and views in MVC

Hi, if I have a page on my site where i have to show 4 or 5 snippets (news feeds, event feed etc), all relating to different data (in different models and db tables), then what is a sensible way to handle the generation of the snippet content and layout? i could use a single snippet controller which contains static functions which each r...

how to integrate Zend Framework MVC with existing site

Hi guys, So I'm slowly tackling OO and Zend Framework and their MVC process in particular. I have an existing website and web-based calendar application that was designed by me, but coded by a different person and done procedurally. I understand that it will be very difficult for my application to ever be completely OO without a full...

Data Access Layer, Best Practices

I'm looking for input on the best way to refactor the data access layer (DAL) in my PHP based web app. I follow an MVC pattern: PHP/HTML/CSS/etc. views on the front end, PHP controllers/services in the middle, and a PHP DAL sitting on top of a relational database in the model. Pretty standard stuff. Things are working fine, but my DAL is...

How check asp.net 4 mvc2 site security?

How check site security on asp.net4 mvc2? I'm only 19 years old and I am very worried if I do not know what a vulnerability. I use LINQ, and it's mean, that SQL Injection - protected. XSS - I tried to use a special library AntiXSS (how check all on site to use it...?). And of course all that I do not know.. Authorization (cookies, inte...

MVC: What would be the best way to keep a reference to the current user in your controllers?

I'm an app where everything is tied to the currently connected user. So far almost all my actions have a call to my UsersService.GetUser(guid) method which brings the user and all its associated data. It does work ok but having said call in every action is really bothering me. After giving it some thought I decided to go with a base con...

Where do I put inline script in head with Zend Framework?

I'm reading the manual here: http://zendframework.com/manual/en/zend.view.helpers.html but I'm still confused. I have a script in my head that I'm converting to the layout/view for the Zend MVC: <script type="text/javascript"> var embedCode = '<object data="http://example.com" type="application/x-shockwave-flash" height="385" width=...

Generate a form from an untyped mvc 2 model or dictionary

HI all, I am looking for a way to generate and validate mvc 2 forms using untyped entities. Basically similar how the propertygrid in winforms behaves. In the utmost basic sample for instance have an dictionary and generate a form from that depending on the datatype in the Dictionary ofcourse it should be able to fill the same dictiona...

sql server query/subquery question

Hi Experts, I have a tables with data like this Id BookId TagId 34 113421 9 35 113421 10 36 113421 11 37 113421 1 38 113422 9 39 113422 1 40 113422 12 I need to write a query (SQL Server) which gives me data according to the tags say if I want bookIds where tagid =9 it should return bookid 113421 and 113422 as it exi...

MVC - Cocoa interface - Cocoa Design pattern book

So I started reading this book: http://www.amazon.com/Cocoa-Design-Patterns-Erik-Buck/dp/0321535022 On chapter 2 it explains about the MVC design pattern and gives and example which I need some clarification to. The simple example shows a view with the following fields: hourlyRate, WorkHours, Standarthours , salary. The example is dev...

ASP.NET MVC 2 project default script files. What do you use?

Many js files are included into Scripts folder by default in ASP.NET MVC 2 Projects. I suppose developers use jquery library nearly every time they program a site, but what about other files? Please, can you tell scenarios and reasons when you: Use Microsoft.Ajax instead of jquery or mix both libraries Use JQuery validation infrastr...

Validation errors are visible when I access the page before I post the form

Hi, I have html validation using client side and server side validation. The problem is when I open the page the validation text is visible before I fill in the text box and post the form. What can I do the solve this issue? I'm using the following code: <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> ...

Where should a site's assets go in a MVC website?

Examples given are from Kohana 3, but the question is not limited to the framework. I've always put my assets in a file structure like this application - classes - views assets - css - js - swf - images -- layout -- content system - classes I've started reading a few forums where people always mention their asse...

Cocoa Controller imports Model, Model imports Controller --> Exception

Hi, why isn't it possible in Cocoa that two Classes both import each other? I tried the following code: Controller.h: #import <Cocoa/Cocoa.h> #import "Model.h" @interface Controller : NSObject { Model *model; } @end Model.h: #import <Cocoa/Cocoa.h> #import "Controller.h" @interface Model : NSObject { Controller *controller; } ...

How to integrate "basic" website into Zend Framework

Hi guys, I have a website that has around 10 pages. Only one of those pages uses Zend (to integrate with Google gData). Right now, it's just all coded into that one page, but I'm wanting to learn how to use Zend Framework. How do you handle basic-relatively static php pages within Zend Framework? Do you just stick the whole individua...

Creating non-framework classes in CakePHP

I'm making a tournament manager in CakePHP 1.3 and I have a tournament controller which is fine but I want to implement a interface that can be used to define how a tournament runs. the controller needs to load a concrete class that implements the TournamentStyle interface that defines how the tournament works. At the end of a round the...

click event launched only once problem

I have a form in which I have many checkboxes. I need to post the data to the controller upon any checkbox checked or unchecked, i.e a click on a checbox must post to the controller, and there is no submit button. What will be the bet method in this case? I have though of Ajax.BeginForm and have the codes below. The problem im having...

Asp.Net MVC Handle Drop Down Boxes that are not part of the Model

I have a small form which the user must fill in and consists of the following fields. Name (Text) Value (Text) Group (Group - Is a list of option pulled from a database table) Now the Model for this View looks like so, public string Name { get; set; } public string Value { get; set; } public int GroupID { get; set; } Now the view is...

IIS hosting, asp.net mvc

Hi I have a site that uses flex and calls controller actions which returns json to the flex. This works fine in a dev server , the folder that has the flex app lives inside the web project and in the dev ennvironment, makes calls hostname, ie www.someurl.com in the actual live scenario, this will be an intranet so not hostname to call, ...