mvc

Can you use JavaScript as embedded resources with Asp.Net MVC?

In Asp.Net with Ajax I can include my Javascript files as embedded resources in my assembly and create references to the embedded scripts using the ScriptManager. Is there a way to do the same with Asp.Net MVC? ...

Anyone still using Stingray MVC?

Years ago I wrote an extensive windows MFC application using Stingray's Model-View-Controller classes. Short learning curve, awesome results -- undo/redo stack, nested scrolling user drawn controls and so on. I would like to reuse or port a lot of the application to .net winforms or WPF. Does anyone have any experience reconciling these ...

C# ASP.Net MVC View Issue

I have an interface that contains a single method called ListAll() using System.Collections.Generic; namespace MvcApplication1.Models { public interface IMovieRepository { IList<Movie> ListAll(); } } I have a class that implements that interface: namespace MvcApplication1.Models { public class MovieRepository : IMovieRepository { pri...

mvccontrib grid default sort order

Anyone know how to set the default sort order for the mvccontrib grid? ...

Where should generating image URLs be handled in JSF?

For a uni assignment, I'm doing a JSF webapp to play poker. Cards in a player's hand are displayed by images. What's would be the "cleanest" way of mapping the card suit/rank to the URL of the associated image? I'm currently leaning towards either using whatever Card#toString returns, or handling this in the backing bean, it's just that...

How can I do this without breaking the MVC framework in CakePHP?

Sorry for what is a generic title. I'm not the best at titles. Anyway the way Cake passes around data (as a hash) is pretty much the reason why I even need to ask this question. If when I passed a variable/obj from the controller to the view, it was an object that I can ask questions to (i.e. $duck->quack() ) rather than having it be an...

Can a View in Kohana access it's parent View's variables?

This applies to Kohana 2.3.2 I've recently started making my Views more dynamic. Using the default template view as a base, now I am doing in the controller $this->template->innerView = new View('article'); Then, in the middle of my template.php, I have <?php echo $innerView; ?> To echo the 'guts' of the article view between my he...

Passing object from view to controller

Is there a way to pass a object, specifically a form_builder object used in a view, to an action in the controller? I am using a link_to_remote and want to update a variable in the controller and then add a new nested form element to my form via a render :update block. If I pass it as a param, it gets converted string and I can't seem ...

Why is ASP.NET MVC MapRoute popping up a Windows authentication dialog box?

This one has me stumped, and I think it might be a bug in Microsoft's MVC implementation. I am building a MVC website using VS2008 SP1. In an attempt to lockdown my website I edited my controller to look like this: 1 public class IdeaController : Controller 2 { 3 [Authorize(Users = "whozmom")] 4 public ActionResult Index(...

ASP.NET MVC Deployed project not working: Inheritance System.web.mvc.viewpage fails?

Hi, i have a MVC project which runs perfectly local. When I deploy to the production server I receive a compilation error: BC30456: 'Title' is not a member of 'ASP.views_home_index_aspx'. It makes me think that the inheritance of System.Web.ViewPage(of T) fails somehow... The project is deployed under http://server/ProjectName. The ...

How do you teach junior programmers MVC?

How do you teach junior programmers to use MVC? This is assuming they never had any experience. ...

ActionFilter to share archived order data and current order data

Just wondering if anyone has used an actionfilter to make it possible to share the view for a specific type between archived info and current info? Example: public class Order { protected IList<int> _products; public Order(IList<int> products) { _products = products ?? new List<int>(); } public virtual void...

Simple MVC NerdDinners Lambda Question

In this code from Microsoft's MVC Tutorial NerdDinners: public class DinnerRepository { private NerdDinnerDataContext db = new NerdDinnerDataContext(); // // Query Methods public IQueryable<Dinner> FindAllDinners() { return db.Dinners; } public IQueryable<Dinner> FindUpcomingDinners() { return from dinner in db.Dinners ...

Do Cocoa NSSortDescriptors belong in the model or the controller?

Would NSSortDescriptor subclasses be placed in the Model or the Controller layer? Since they are primarily for display and business logic, it seems to make sense to put them in the Controller layer. But it also makes sense that models should know how to sort themselves. ...

How to use Zend Framework for layouts only?

I was recently brought on to help with a project that was made up of individual HTML files with the exception of a PHP contact form. So there's not even a hint of object oriented programming, MVC, or layouts (or even PHP for that matter). The project is quite large, but I wanted to slowly integrate the Zend Framework into this project, ...

How do I know when to and whether to have a separate controller for a piece of code?

So I am in a situation where I have to decide whether or not to have a separate controller for a particular piece of code. We have a home page that acts like a hub for the rest of the site. The page is accessible to all users (logged in as well as non-logged-in). I was thinking about having home as a separate controller and an action cal...

clientside localisation

I have a colleague who thinks this alert('<asp:Localize ID="ErrorAddingComponent" runat="server" Text="There was an error adding component: " meta:resourcekey="ErrorAddingComponent"/>' + errortext); is a good idea if we get an error from an AJAX call, the errortext is the parameter of the function called on error from a jquery ajax, ...

Where is the best place to put a model in Zend Framework?

I want to know where is the best place to put the model classes inside a Zend Framework project. I heard that inside the library is the better place with versions < 1.8. And with version 1.8 we have the ResourceLoader so we can put inside the modules dir. What's your method? What's the best practice? ...

Is it ever too late to implement an architectural pattern such as MVC or MVVM?

I've been unleashed on version 2 of an application my company has been working on. It was our first foray into WPF and needless to say, a lot of lessons were learned. The product took a year to develop, so it's not a small application by any means. Everyone recently came on board with MVVM. Now that we have a large code base with ple...

How do you close an ASP.NET MVC page from the controller?

I have an ASP.NET MVC app that opens a "Request" view in a new browser window. When the user submits the form, I'd like the window to close. What should my RequestController code look like to close the window after saving the request information? I'm not sure what the controller action should be returning. ...