I am new to asp.net mvc in general and have yet to build a fully functional application. The main reason for this is I couldn't get my head around building administration areas.
I am now looking at MVC2 and have noticed this new feature called areas, I have created a sample application with an area called Announcements (essentially a blog post) does anyone know where a simple example may exist or could you provide one to do the following:
Show a working Admin area for Posts/Announcements.
Show how to display the posts/announcements to the public.
I assume these concepts are simple enough to do and I am probably struggling because I am looking at it from a web forms way.
Any help would be greatly appreciated.
It sounds like you are struggling with some of the basic concepts of MVC. Scott Hanselman's NerdDinner tutorial would probably be very beneficial to you. It goes over the fundamentals. The tutorial is for MVC 1, so "Areas" are not explained, but once you understand the basic MVC concepts "Areas" should come naturally.
Related
I'm looking for a 'model' website/application written in ASP.Net that illustrates current best-practices of architecture, design, code etc. that could be used as a blueprint for development?
I'm working in ASP.Net webforms, but would like to get into MVC so examples from both would be very welcome.
Thanks.
Nerd Dinner might be worth a look for MVC, it comes with a 185 page pdf walkthough of the code with screenshots. I think it was built as an example for the book ASP.NET MVC 1.0.
There's a bit more info on Scott Guthrie's blog
You can have a web site that uses ASP.NET MVC and ASp.NET Webforms at the same time. Google it and you'll find dozens of samples. But if you weant to see an example of how to implement MVC Pattern* in ASp.NET Webforms projects, take a look at: http://www.codeproject.com/KB/aspnet/mvcwebforms.aspx
It is very hard to find full blown best open source asp.net MVC sites. Here's the ones that go beyond beginner concepts.
Code Camp Server
Kona
Orchard
Kobe... where are you?
With only mild programming experience in the past, I was wondering about C# and ASP.NET MVC..
Do you guys think it's a better idea to learn C# before learning ASP.NET MVC? I've already delved a little into both of these already, but I still need some help deciding.
I think I would be a much stronger MVC user if I had more knowledge of the C# language itself.
What do you guys think?
Thanks!
If you're going to use C# to code your ASP.NET MVC Models/Controllers/etc. then yes, learn C# before you dive into ASP.NET MVC.
That way, you'll be able to better handle the language issues you're going to run in to when composing your .NET MVC application. Otherwise you're going to be trying to learn two things at the same time and not get a good grasp on either one.
Master C# first, then go to ASP.NET, then learn MVC and other patterns. Don't bite off more than you can chew, newbie mistake.
I agree with your third paragraph with C# at your back you'll be a stronger ASP.NET MVC developer; but I also think that they (C# and ASP.NET MVC) make great co-learning tools. And if you're going to try to pick up both tools, doing it together makes a lot of sense.
ASP.NET MVC is a pretty tough framework to start out on. It assumes you are already versed in ASP.NET, and ideally you even have a little bit of Ruby on Rails or similar experience too (ASP.NET MVC was really influenced by rails). On top of all of that good knowledge of C# is also very helpful.
I guess it depends on what your needs are. Are you going to create a mission critical webapp that your business depends on? In that case, yeah really learn ASP.NET and C# well. If this is just for a hobby and/or learning, then I say just go for it and learn C# as you go.
I jumped into Rails and Django without learning Ruby or Python first.
You learn what you need to know pretty quickly and everything you do learn is always guaranteed to be practical and immediately useful.
If you already understand MVC you already know which piece of code does what.
Knowing C# before jumping into anything .NET related is very recommended if not required. MVC is only a way of making webpages with the tools of ASP.NET which uses C# and VB as its backend languages. MVC is actually called ASP.NET MVC. Think of C# as the equivalent to PHP or Ruby in "Ruby on Rails".
Learn C# first. C# will be around for years to come; MVC may or may not be (Microsoft has a long history of handling web site code with flavor-of-the-month paradigms that don't age particularly well).
I have to disagree with Matt Greer about any assumption for MVC that you are already versed in ASP.NET. Nearly all of the tutorials and/or books that I've come across definitely do not start from an assumed ASP.NET knowledge base. In fact, for a junior developer, I'd think that knowledge of ASP.NET would be detrimental and confusing, as ASP.NET adds a whole bunch of stuff (designers, viewstate, abstractions, etc) that really is sort of the antithesis of ASP.NET MVC development.
ASP.NET MVC, however, is a framework that definitely requires knowledge of C# or VB to implement properly. In the end, any of the code that drives the site will be written in C#. The ability to properly write .net code is a definite requirement.
I'm personally very partial to Apress books, so I'd recommend the following:
Apress Beginning C# 2010:
http://www.apress.com/book/view/9781430231714
I'd also recommend from experience
Apress Pro ASP.NET MVC 2:
http://www.apress.com/book/view/1430228865
Another really great series for learning ASP.NET MVC 2 is the screencast series available from tekpub at:
http://www.tekpub.com.
Asp.net MVC is a framework for web development on top of .net developed in C#.
So if you want to know the priorities(not necessarily in a waterfall model, you can learn them in parallel):
First you must learn C#(some oo priciples and the way you must structure your code).
Second you must learn the rules and techniques
in web development (Html, Css, javascript, Web Architecture and the way it works(concepts like session management, cookies, etc) ...)
and Last learn
the Asp.net MVC
I guess the title gives most of my question away, I have a university project in which I must design and create a website in php or asp.net I have chosen the asp.net path since I am pretty familiar in php and I prefer C# to php.. Could someone please reference some good online places to visit to do some further learning, and recommend some books would appreciate it thanks.
Here are several questions from StackOverflow that may help:
Best way to learn C#
How can I learn ASP.NET?
What’s the best way to learn C# quickly?
Quickest approach to learn C# programming
-MSDN Library
-Book: CLR via C#, Apress Pro ASP.NET MVC (for ASP.NET MVC), and Pro ASP.NET 3.5 (Webform)
I think the Wrox Problem-Design-Solution books are always good if you like tutorial style books.
ASP.NET 3.5 Website Programming: Problem - Design - Solution
If you're looking at MVC, Microsoft has the excellent Nerddinner tutorial
Nerddinner
MVC is overkill for a basic university project site. Get a basic site similar to what you need (Website or Web Application project), perhaps from the free community projects on the ASP.NET home site, and then follow the video tutorials there using the freely downloaded site as a starting point :-)
I'm looking into microsoft's version of MVC as a framework for a site redesign that I'm about to begin.
I am not totally new to MVC, I worked on a java app using MVC. We used the DOJO javascript library to make asynchronous calls back to the actions to update views.
What are some of my choices to do the same in .net MVC?
I'd like an excuse to get my hands dirty with jQuery, is this a good one?
JQuery is definitely useful for this. If you or your company has any 3rd party control such as the Telerik RadControls for ASP.NET you can give those a try too. I think they are free for beta right now.
However, the best starting point is always looking at code that already exists. There are also tons of examples of AJAX with MVC all over the net.
Nikhil Kothari's Example
David Hayden's Example 1
David Hayden's Example 2
Scott Hanselman's Example
Go download the NerdDinner example that ScottGu, ScottHa etc. worked on for their book.
jQuery is one of the most widely used javascript frameworks used with ASP.Net MVC, also check out ExtJs. We use ExtJs at work and I think its been documented well and its very easy to use. The jQuery community is a lot bigger though so I would say its a safer bet
Sure you should go with JQuery..You have already experience in MVC, I think you will not take much time to understand JQuery.
http://visualjquery.com/
I'm developing a website , job portal. I have 2-3 years of ASP.NET webform development experience,
I want to create a professional job portal site (to improve and learn more) but trying to decide on best architecture. Any suggestions or advice will help...
Thanks
Well, there are a number of ways to answer this question, and I'm sure many others will chime in. I'll just say that since your goal is to improve and learn more, and you already have 2-3 years of webform experience, this might be a good opportunity for you to learn MVC. Then you will have experience in both, and can make more informed decisions regarding the best architecture for future projects.
Happy learning!
Whilst nobody can tell you exactly what to do, the team I manage is about to release a new CMS / Job portal using ASP MVC. MVC gives us excellent testability and scalability out of the box and it can be quickly combined with tools such as nHibernate / windsor (IOC) / nCache / jQuery - this ensures that you have a wealth of resources on the internet to help accelerate your development and skill. You can also embrace standards such as XHTML 1.1 strict, which is almost impossible with ASP.Net webforms due to the auto generated HTML
1 other advantage is that you also get away from the dreaded ASP.Net viewstate.
Use ASP.NET MVC if you want to:
learn the ASP.NET MVC framework
use jQuery or similar libraries
really learn web-languages (HTML, CSS, JavaScript)
use Test Driven Development
have a clean separation of concerns
If you don't have the time or will to learn to use the ASP.NET MVC framework correctly, stick with ASP.NET WebForms.
My answer is almost always "ASP.NET MVC." The amount of flexibility and features and testability and maintainabilty and ... heavily outweigh WebForms.
WebForms has the advantages of a rich ecosystem of existing controls and documentation, and is really powerful for some kinds of tasks (complex, multi-form interactions), but I find its limitations get in the way far too often. You have to mold yourself to it.
It really depends on what the end goal of the application is. As Scott Ewers said, if your goal is to learn, then using ASP.NET MVC will expand your breadth of knowledge in the ASP.NET space (since you already know web forms).
Additionally, if this is going to be a public product, you can leverage the testability benefits of MVC and run automated unit tests. Key ideas like Separation of Concerns can also increase long-term scalability and maintainability.
The primary reason why you might choose web forms is if you are rapidly prototyping the job board application. As you know, web forms allows you to drag-and-drop components onto the canvas to quickly create some basic data entry functionality.
There is a herding code podcast from May 13 on the subject.
Herding Code 47: Joe Brinkman on Webforms vs ASP.NET MVC.
I also agree that choosing MVC would have the advantage of allowing you to expand your knowledge. That not being the only reason, given the choice as well I just finished a small MVC project (my first) and let me tell you MVC rocks! Its a great framework which I feel gives you more flexibility and at the same time out-of-the-box tools to create a web app quickly and painlessly. It was my first experience with VS2008 & .NET FW 3.5 & LINQ, and all the guides at www.asp.net helped me go forward quickly (especially the free tutorial chapter from an MVC 1.0 book mentioned here).
I also got to learn JQuery along the way, as it is very much integrated into these new technologies.
One think to take note though is that this being a new tech, version 2 is already being cooked up, so if your project is for the long run, have that in mind and plan accordingly (in my case, being a small project, I'll probably try upgrading my project to version 2 when its officially released). Yet at the same time, having a fully MS (and thus MSDN) supported version 1 was a godsend for me...
Good luck!
I have good experience in Jquery, CSS, HTML, Javascript but not in TDD.
I have time..and willing to learn MVC but wasn't sure MVC is good choice for Job portal or similar site..
This can be considered a shameless self-advertisement but here is my quiz on how to choose between the two:
http://sietch.net/ViewNewsItem.aspx?NewsItemID=101
I was recently tasked by one of my clients to write a paper, or simply a checklist, that would help other lead developers make this same decision.
I posted the first 2 rough drafts on my blog. I am admittedly pro-mvc but the paper/checklist has been we received so it might be helpful.
http://eric.polerecky.com/archives/a-somewhat-less-biases-comparison-of-mvp-and-mvc/[http://eric.polerecky.com/archives/a-somewhat-less-biases-comparison-of-mvp-and-mvc/][1]
I think the most often overlooked benefit of MVC is convention; I really see any convention in webforms projects and while not strictly enforced in MVC projects at least its there.
i started developing our current app in webforms, mvc wasn't available when development started.. i've chosen the MVP pattern, with URL rewrite HTTP module. currently i'm investigating plugging in some MVC into this, basically to use the front-controller instead of using page-controllers. the other things in already established MVP architecture with web forms in my app give me more flexibility than pure MVC approach without WebForms, which i like, although require a bit more code than MS MVC examples (never tried it for real project to see if it stays that way, like in those examples in screencasts).
what i don't like with MVC is mixing control code inside templates - i believe loops, ifs and stuff like that just shouldn't belong inside the template. but a couple days ago i've ran into Spark view engine that looks kind of promising in that segment, although not still close to the Tapestry 5 (a component-based webGUI framework) in the java world.
But the above mention suggestion to mix both might work for you to explore MVC world and have the safe ground to fallback to if something won't work for you might be ok for you.