mvc

Where can I learn/find examples of MVC for PHP?

I'm trying to learn more about MVC but I would really like some examples I can play with and modify to help learn the concepts and my language of choice is PHP. Books/websites are preferred, thanks! EDIT: I didn't really want to use a framework... ...

New to MVC | Data in a view from different sources

OK, So i have been watching some MVC vids and reading some bits. I am new to the entire MVC pattern, and until now have been happily wrapped up in the web forms world! Like with so many demos it all seems great and I'm sure I'll have lots I dont understand as I move along, but in the first instance... I can see that you can have a stro...

Determining the results count of ViewData

Hi I have a view with several User Controls and I pass ViewData to all of them, I would like to know how you would determine the element count by specifying the string key. I understand that you cannot use comparison to an integer because ViewData is an object but I have it setup this way for explaining my question. I have also tried nul...

ASP.NET MVC Beta 1 - Will My Existing User Controls Work In My Views As-Is?

I understand that you can now create MVC-specific user controls, but will my existing standard ASCX user controls work in an MVC view? I understand that MVC pages have a completely different lifecycle but will, for example, a Page_Load method be invoked as normal when the control is sitting in a view? ...

asp.net mvc & popup dialogs

What do people recommend for creating popup's in ASP.Net MVC? I have used the ajax toolkit and component art's methods in the web forms world and am looking something with simillar capability. What JQUERY plugins do people like? SimpleModal, JBOX (I think this was what it was called) Is it worth exploring pulling out the javascript fr...

Why isn't my page redirecting to the login screen for this protected page?

Hi, I added the following to my web.config to redirect the user to the login page if they aren't authenticated, but going to the URL does cause a redirect? <location path="user/add"> <system.web> <authorization> <deny users="?" /> </authorization> </system.web> </location> I have setup forms authen. lik...

C# MVC - Strongly type viewdata

i create a strongly type LocationViewData has a properties ... public Location location { get; set; } ... which is Location model (location.address, location.country ..etc) in controller public ActionResult Edit(int id) { ... LocationViewData ld = new LocationViewData(); ... return View(ld); } in view codebehind ...

C++ Static member method call on class instance.

Here is a little test program : #include <iostream> class Test { public: static void DoCrash(){ std::cout<< "TEST IT!"<< std::endl; } }; int main() { Test k; k.DoCrash(); // calling a static method like a member method... std::system( "pause "); return 0; } On VS2008 + SP1 (vc9) it compiles fine : the cons...

Service Layers and Repositories

I've been using MVC frameworks for a short while now and I really like how the concerns are separated out. I've got into a bad habit of letting the controllers do quite a bit of work. So I'm really looking for some advice. When I first started using MVC I quite often had the controller doing manipulation on the models after database w...

MVC.NET for the desktop

Is there any reason that MVC isn't equally useful for desktop apps as for web apps? What would be required to make an ASP.NET MVC directory tree implementable as a desktop app? ...

Cannot use smtpclient to send mail with localhost iis site

I have an asp.net mvc app running on a local iis website that is failing to send mail using SmtpClient from System.Net.Mail. I am trying to send a mail to my hotmail address and I get a socket exception. Any idea what the problem might be? using(var message = new MailMessage()) { message.From = new MailAddres...

In mvc pattern how to show another view

Hi im developing an winform application using mvc pattern, If i have a windows form as a view with a button in it, and i want to show another view(winform) on click of button in the first form. In this case whether the view should should notify the button click to the controller and the contoller will instantiate the second form and s...

Why was validate request taken out of ASP.net MVC?

In standard ASP.net applications ASP.net offered some protection from XSS attacks with validateRequest throwing detect dangerous input errors if some one tried to. This functionality seems to have been taken out of MVC any idea why? Thanks, Alex ...

How to fight against really big controllers . . .

I have an winforms application that was built using MVC. The controller is subscribing to all of the events from the view (button clicks, etc) and connects multiple views with the model. The problem is that the controller is now about 3000 lines of (hard to unit test) code. What is the best practice to avoid getting controllers to do...

Common Design Patterns for use in MVC Web Applications

I am trying to coach some guys on building web applications. They understand and use MVC, but I am interested in other common patterns that you use in building web apps. So, what patterns have you found to fit nicely into a properly MVC app. Perhaps something for Asynchronous processes, scheduled tasks, dealing with email, etc. What ...

Where is the best place in an app to do validation? Rules of thumb?

I am making a C# app for a class project. I want to ensure a string has one of three values. Normally, in a web app, I would do validation with javascript on the client side. However, this is currently a console app. I know that I should do the validation early, but what are some good rules of thumb for validation? ...

ASP.NET MVC Session State

Hi Guys, I am currently trying to create an upload control with progress bar in MVC using jquery. I keep running into a problem however in that mvc doesn't work in parallel threads? When I upload a file and show the progress during upload from JS performed through several callbacks to server, I am trying to get information about curren...

How do I find out the name of the current controller/action/view?

I have some code that I am putting in the code-behind of a master page. This master page is my main layout and the purpose of the code is to check whether the user is logged in and take the appropriate action depending on whether they are or not. I would be interested in hearing alternate methods on how to approach this, but I am doing i...

Can any processing be done on the model? [MVC]

So I've decided to make a big push towards MVC for all new sites I make. I have a question about whether or not you can have any processing on the model level. The case that brought up this question is a video site. I have a Video class (model) and one of the things I need to do when a user views the video I need the view to be logged...

How do you handle templates for MVC websites? [PHP]

I have this marked as PHP but only because I'll be using PHP code to show my problem. So I have some code like this for the controller: switch ($page) { case "home": require "views/home.php"; break; case "search": require "views/search.php"; break; } Obviously there's more pages but this should...