mvc

How should I split MVC models in my PHP app?

I have a PHP site based on a simple MVC principle. I currently have one model file with many functions for getting data from the database. However, it's becoming a little monolithic now so I'd like to split it into separate models. The question is - what's the best way to do this? Is it a good idea to create a class for each table, so I...

MVC: how to ajax?

I'm going to start a project using a Zend Framework MVC implementation. How do I work with ajax? I mean, should I place all ajax code into controller? Or into view? For example, I want to get posts from author 'ivan' to show on a page. Normally, I create a link to '/posts/author/ivan' or smth like it, create a new Action like 'byAutho...

help with linq to sql

Help me with this algorithm please. var companies = companyrepository.GetAll().OrderBy(sidx + " " + sord).Skip(pageIndex * pageSize).Take(pageSize); string where = ""; if (op == "eq") where = field + "=" + data; else if (op == "cn") where = field + " LIKE '%"+data+"%'"; ///here lies my problem companies = companies.Where(where); ...

In trying to follow MVC, where should each of these elements go?

This is my first foray into "appropriately" using an MVC construct (with Code Igniter). I'm hoping some guru can wave her hands and tell me where the following code elements belong. I have them written, I just want to plunk them in the "right" spot! Call a DB and see if we have a user signed up Route to a signup page Route to the main ...

Why use an MVC framework when Servlets, JSPs and a lightweight DAO layer will work?

I'm finding it difficult to embrace a Java MVC framework, when it looks as if Servlets, JSPs and a lightweight DAO will do just about everything you need it to do in order to decouple the controllers/views/models. For PHP I can see the necessity since there are no built in constructs like servlets, but do Java MVC frameworks really give ...

Microsoft Ajax script extensions - same in both ASP.NET AJAX and ASP.NET MVC?

Are the client side javascript extensions, e.g. MicrosoftAjax.js, the same in both ASP.NET AJAX (for ASP.NET WebForms) and ASP.NET MVC? For example, does it still include: Global Namespace Sys Namespace Sys.Net Namespace Sys.Serialization Namespace Sys.Services Namespace Sys.UI Namespace Sys.WebForms Namespace although I'd suspect t...

asp.net mvc data annotation with subsonic 3.0

Hi Has anyone built an application using asp.net mvc with data annotation for validation and subsonic 3.0 for BOL generation? I am using IDataErrorInfo in partial class at the moment and would like to move to data annotation but i'm not sure how to do it with subsonic 3.0 has my object generator. I'm using MVC 1.0 I would like to fi...

Can a CakePHP model change its table without being re-instantiated?

I'm working with an unchangeable legacy database schema where each instance of an object has its own table in the database with associated records. I need to change a model's useTable every time the model is instantiated, but retain Cake's nice caching and what not. Say I have many pad objects, which each have several note objects (Not...

Complex software architecture

Hi everyone ! I've got a few questions about the architecture of a software that I'm working on ! So basically, this software allow the user to access to some popular sites : Social networks (Facebook, MySpace, ...), Common services (RSS, Mails, Twitter...), Social bookmarkings (Digg, Delicious...), Chats (MSN, AOL...), ... Cur...

asp.net mvc Ajax.ActionLink problem

I am doing something wrong and I can not figure out where... I have this in my view - CreateForm.aspx <%@ Page Title="" Language="C#" Inherits="System.Web.Mvc.ViewPage" %> <%= this.Ajax.ActionLink("Create New", "CreateForm", new { nr=ViewData["Nr"]??0 }, new AjaxOptions { UpdateTargetId = "panel" + (String.IsNullOrEmpty((stri...

Full stack versus non-full stack MVC PHP frameworks - what's the difference?

I keep seeing CakePHP and CodeIgniter referred to as full stack MVC frameworks, whereas Zend Framework is said to be non-full stack. What exactly does this mean? ...

new control().ResolveUrl("") not working on deployed.

Hello guys, I have an application using MVC. In my controller I have their a viewdata[] which contains the image path (Viewdata["dd"]=new Control().ResolveUrl(path)). This will work on my local but on the deploy it will not work anymore. Anybody have experience this scenario? Your reply is greatly appreciated. Best ...

URL Rewritting + ASP.NET MVC

Hi Guys I have a issue that they users here want urls like http://host/Post/PostTitle Is this possible? As your not passing in the action? regards ...

2 controller and 1 view in ASP.NET MVC

I have 2 controllers, task and user. I need to create a view for "create task to users". So I need "a user list" and "create task" view together. Usually views inherit from only 1 class. How can I create a view working with 2 classes? Have any idea? ...

how to auto refresh MVC PartialView every second

Hi , i need to auto refresh a partialView in the page every second (or a set interval of time) i thought of the following method is this rite loop { setInterval(function() { <%Html.RenderPartial("partialview", Model);%> } ,1000 ); } or is there a better way using ajax stuff ? ...

MVC Unit Testing with Linq to Sql

I have a controller that is working in my site but failing during unit testing. It is pretty simple and depends on Linq to Sql to return a collection of JSON objects. The Test fails because the DataContext can't find the connection string when called from outside the MVC project. I had a look in the auto generated code: public DC(): ...

Is this a correct interpretation of MVC?

Say you have a customer object and the "customer file" form that manipulates that object. Is the following a correct interpretation of MVC? Customer - Model CustomerForm.cs - Controller CustomerForm.desinger.cs - View Even though CustomerForm.cs and CustomerForm.designer.cs are partials of the same class, it seems to makes sense from ...

Http Modules are called on every request when using mvc/routing module

I am developing a http module that hooks into the FormsAuthentication Module through the Authenticate event. While debugging i noticed that the module (and all other modules registered) gets hit every single time the client requests a resource (also when it requests images, stylesheets, javascript files (etc.)). This happens both when r...

Debugging mvc web application using subdomains in Visual Studio?

If I want to use subdomains for images, stylesheets and javascripts on my website (like img.domain.com), how would you set it up in Visual Studio 2008 so I am able to debug the website on my local computer? Is it possible ? and how ? The webdev server always uses localhost:port, is there anyway to map etc. img.localhost:port to a speci...

How to mock up a static method in a static class with URLHelp? (Moq)

I have a extension method. Can any one help me how to test this method with Moq? public static string GetBaseUrl(this UrlHelper urlHelper) { Uri contextUri = new Uri(urlHelper.RequestContext.HttpContext.Request.Url, urlHelper.RequestContext.HttpContext.Request.RawUrl); UriBuilder realmUri = new UriBuilder(contextUri...