learn more about riagenic
17 September 2008

Playing with ASP.NET MVC.

I must say, ASP.NET has always been a love/hate relationship with me and it has nothing to do with the technology, more my mind trying to melt to the way ASP.NET works vs JSP/Coldfusion.

Hey, I spent 10 years doing the later, groking ASP.NET in terms of concepts has always tripped me up.

ASP.NET MVC however for me is very similar to Mach-II in Coldfusion. So much so, I wanted to look for a way to have a Controller sit in one spot, but bring in Views from another (ie not automated, but wanted to configure it myself).

I searched online as best I could and couldn't find it, and part of the blame for this is simply "how do I phrase the question".

I then went back to what i've jokingly called "MVC Bible"  Stephen Walther's blog. I clicked on his Tips (as I was frustrated and decided to take my mind off the problem and see what's good in MVC via Stephen) and then I noticed this post on how to do it..

The magic answer is:

 

  1:     public class UserProfileController : Controller
  2:     {
  3:         public ActionResult Index()
  4:         {
  5:             ViewData["Title"] = "User Profiles";
  6:             ViewData["Message"] = "Welcome to ASP.NET MVC!";
  7:             return View(@"~\Views\Admin\Security\UserProfiles\ViewAllUsers.aspx");
  8: 
  9:         }
 10:     }

It's that simple.

Ok, with that, I went off and continued coding and it all now is singing together nicely. The point of this thread is that I love how Stephen's structured this approach, basically "Tips for MVC".

I'd love to see someone do this for WPF & Silverlight in such a structured fashion.

Anyone?

Filed under: , ,
 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 

  
Enter Code Here: Required

About scbarnes

Scott Barnes currently is a Rich Platform Product Manager (WPF & Silverlight). He has been working with Adobe/Macromedia technology for the past 10 years with a main focus specifically on Internet Applications (aka. RIA, Rich Client Technology etc).

Scott first started out as a graphic designer in the late 90’s and over the years developed a passion for programmatic art (Designer + Developer mind). He recently has branched out further into 3D modelling and animation making full use of both his designer + developer mindset.

"..The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man..." - George Bernard Shaw
Page view tracker