mvc

How do I call other Controllers within a Zend Framework Process and retrieve their rendered view?

Hi there, I have the following setup: An endless running PHP process that looks at a job queue which contains module names, controller names, action names and a parameter array. For every job I want to call the given controllers action and retrieve the rendered view for further processing. I was thinking about bootstrapping an instan...

Ninject 2 with MVC 2 Case Sensitive Controller Names

I have a new MVC 2 project using ninject 2 for IOC. I have the following global.asax which sets up both NHibernate and Ninject. The code runs fine, ninject pulls out the controllers from the assembly (it does convert them to lowe case strings when it does this - inside the Ninject source). All my controller URL's are now case sensitive ...

MVC: Does the Model or Controller validate user input

What part in the MVC does user input get validated? For example, user registration system, the user inputs data in the View, where does the user's input get cleaned and validated for the correct input, eg. correct email, applying php cleaning functions..would this happen in the controller or the model? and which would decide what errors ...

What is the difference between an MVC Model object, a domain object and a DTO

Hello, What is the difference between a MVC Model object, a domain object and a DTO? My understanding is: MVC Model object: Models the data to be displayed by a corresponding view. As such may not map directly on to a domain object, i.e. may include data from one or more domain objects. Client side May contain business logic, e.g. ...

problems with bulk editing in MVC 2 C#

Im having issues when trying to post a IList back to the controller here is some of the code My controller public ActionResult Approvals(ICollection<ApprovalListModel> model) { My pages <%@ Page Inherits="ViewPage<IList<Book>>" %> <% for (int i = 0; i < ViewData.Model.Count; i++) { %> <%: Html.TextBoxFor(m => m[i].Title) %>... B...

Should I write from Controller, Code Behind, or Helper in MVC?

I've seen all the questions and answers around not having code-behind for a view, however I have a case where I need complex logic to generate the presentation (view) layer. I have to output a PDF file based on data obtained from db. Where is the best place to generate this PDF and write to the response stream? Doing response.write fr...

Value of the name of my radio button is getting encoded?

I have an rb named RB but when i request it in the action i noticed that it is getting encoded to something like _ctl100_RB. How can i prevent th is or encode to get the right value? What I would like to happen If Request("RB") = "opt1" then WHat is actually happening If Request("_ctl100_RB") ...

Is Events Bubbling pattern applicable to hierarchical model?

Lets consider following example, I have "Document" object which contains collection of "Person" objects and each "Person" object has collection of "Address" objects. When one of the "Address" object changes I need to call server-side method to calculate optimal path between all addresses of a person(whose "Address" was changed) and updat...

Getting CodeIgniter to add load->view->header for error fields

How do you get CodeIgniter to load views before it loads the files in application/errors? I have custom error pages but I want them to be displayed beneath the header and menu_bar views. ...

MVC Validating Strongly Typed Views

I have following ViewModel: public IEnumerable<SelectListItem> SelectAdminsInGroup { get; set; } public IEnumerable<SelectListItem> SelectAdminsNotInGroup { get; set; } public model.Admin Admin { get; set; } Admin class: [PropertiesMustMatchAttribute("Password","ConfirmPassword")] public class Admin { public ...

My Own PHP MVC Framework for learning purpose only

Hi, I am a great fan of Zend framework and somehow i have modified it in my own way. I have been using it from around a year but still i lack knowledge of some internal workings. So i decided to design my own framework to understand inner things. I just want from you guys to provide resources about it, articles, tutorial or any book. I...

Why this sample ASP.NET + Jquery + javascript custom MVC doesn't show something ?

I tried to integrate this javascript mvc sample http://www.alexatnet.com/content/model-view-controller-mvc-javascript into an asp.net page, I'm complete beginner at jquery and nothing shows up, why ? Update: I have added missing html listbox but now no javascript seems to execute to initialize the listbox nor the buttons seem to work <...

Creating a body ID in CodeIgniter

Is there a way to create a dynamic body id in codeigniter for different pages that converts spaces to dashes? I have been around forums and search engines but I have no luck. Here is my code: <body id="{$template.title}"> Here is the output: <body id="About us"> I want it to be: <body id="about-us"> let me know Thank you ...

Microsoft MVC: trigger form validation manually

Hi, does anyone know if there is a way to trigger the client side form validation in a .Net MVC app manually? I want to do the following: <script type="text/javascript"> if([form valid]) { //do something } </script> I already looked through the code in MicrosoftMvcValidation.js but didn't find a method I could call on...

MVC Framework and CMS

I'm wondering just where a CMS - out of box like SiteFinity, Sitecore, SharePoint, DotNetNuke, etc. - fits with the MS MVC Framework (1 or 2). The MVC Framework presents a lot of benefits for developers and for overall SEO and SEM value, while most CMS platforms require a lot of the WebForms "stuff" that comes with ASP.NET. Thoughts? I'm...

FX Cop still erroring after i suppress

<System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", Justification:="Needs function to return two values.")> _ <System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification:="Needs function to return two values.")> _ I am trying ...

Magento - Create a minimum shipping charge.

We use USPS API for international shipping. The API returns a shipping cost and we add % Handling charge. We want to set a minimum charge, e.g., if shipping + handling is less than $5 we want to set the shipping price to $5. Would this require writing a full shipping module or just adapt the USPS module? ...

How to pass progress to MVC page

I have a delegate method with is called periodic while WritingAnObject uploading the file. I would like to update div (ProgressUpdate) in my MVC page with args.PercentDone value. I appreciate any idea? Thanks, //delegate method private void displayProgress(object sender, ProgressArgs args) { //Console.WriteLine(args.Percen...

Proper use of Beans in Java MVC

I'm trying to make a deliberate effort to write code that follows proper convention, even when it might add complexity, and so far I've succeeded but I'm noticing a trend in my programs. My project is small, a javaee webapp with only a handful of servlets, follows MVC design, and makes use of beans as the model. My problem is that my b...

To get Analytics data and show on page what's the most popular items, should the code belong to Model, Controller, or View?

Suppose there is a call to get Analytics data from a third party or through our cache data on a server, for the "most popular items", and we show these items' names on all of our pages, should we put this code in Model, Controller, or View (Helper) component? Maybe it is not strictly Model, because it is not directly in our data store. ...