1 / 21

Learning WebMatrix Part 3 of 3

Learning WebMatrix Part 3 of 3. Akber Alwani http://twitter.com/epdotnet. Agenda. Part 1 What is WebMatrix? Razor Syntax Database Access WebGrid Part 2 Layouts Helpers Themes, Package Manager, Facebook and more Membership Routing Part 3 Building Helpers WebMatrix and OSS Web Apps

egan
Télécharger la présentation

Learning WebMatrix Part 3 of 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Learning WebMatrixPart 3 of 3 AkberAlwani http://twitter.com/epdotnet

  2. Agenda • Part 1 • What is WebMatrix? • Razor Syntax • Database Access • WebGrid • Part 2 • Layouts • Helpers • Themes, Package Manager, Facebook and more • Membership • Routing • Part 3 • Building Helpers • WebMatrix and OSS Web Apps • Publishing your website or web app • How to “grow up” to Visual Studio 2010 and ASP.NET MVC

  3. Why Build Helpers? • 1. Helpers make you more productive • Create Helpers for code that is repetitive • Create Helpers for code that is complex • 2. Helpers make it easier for other developers to use your widgets or services • Useful if you are trying to create a developer ecosystem of your own

  4. Build a Helper: The 3 Approaches

  5. Building Helpers – inline syntax • Use CSHTML • Save in App_Code folder • The name of the file is important – it’s used as the class name: @FacebookSocialPlugins.ShowLoginButton(...);

  6. Building Helpers – inline syntax • @helper • Easy to create HTML shortcuts • Wrap commonly used HTML • Takes parameters • Real example: Facebook Social Plugins @helper HelloWorld(string name = "") { <div>Hello @name</div> } @helper ShowLoginButton(string buttonText = "") { <fb:login-button>@buttonText</fb:login-button> }

  7. Building Helpers – inline syntax • @function • Return values from your helpers • Good for wrapping complex APIs • See the Twitter Helper for examples @functions { public static string SayHello(string name) { return “Hello ” + name; } }

  8. Demonstration Building Helpers

  9. Why use Open Source Apps? • Free & Popular • Large developer ecosystems with lots of widgets, plugins, templates and themes • Good community support through blogs and forums • Gets you closer to a solution • CMS, eCommerce, Forum etc. • Easy to configure

  10. WebMatrix and OSS Apps • WebMatrix builds on the success of the Web Platform Installer 2.5 Million Apps downloaded so far

  11. Demonstration Install a WEB app

  12. Publishing your website • It’s easy to find a host that fits your needs and budget • Publishing your website is easy and pain free • Faster and more secure • If you make changes, you only upload the changes – not the entire website

  13. Windows Web Hosting Gallery • Find the right host for you • Quickly compare the best deals • www.microsoft.com/web/hosting

  14. Publishing in WebMatrix • Easy to configure, preview and publish your website and database in one click

  15. Demonstration Publishing your website

  16. Growing Your App With a little luck, your web application will be successful and attract lots of users! • Congratulations  • You need to ask yourself some questions: • Do I need more developers? • Is my code base still manageable? • Do I need to scale my web & database servers? With a successful application the answer will normally be “YES” to those questions

  17. Growing Your App • Visual Studio 2010 provides the best solution to your “growing” needs: • Powerful editing capabilities • Testing Frameworks • Source/Version Control • Moving to Visual Studio 2010 is easy • The Razor Syntax is common across WebMatrix and ASP.NET MVC 3 • You can use Helpers in ASP.NET MVC 3 • Migration of database to IIS Express is easy to do

  18. Demonstration Growing your app

  19. Recap • Part 1 • What is WebMatrix? • Razor Syntax • Database Access • WebGrid • Part 2 • Layouts • Helpers • Themes, Package Manager, Facebook and more • Membership • Routing • Part 3 • Building Helpers • WebMatrix and OSS Web Apps • Publishing your website or web app • How to “grow up” to Visual Studio 2010 and ASP.NET MVC • Roadmap

  20. Get this content, and more • www.webcamps.ms • www.asp.net/webmatrix • www.microsoft.com/web/webmatrix

  21. You are a Web Camper! • Join in the community! • Facebook Fan Page (search for Web Camps) • Follow @Webcamps on Twitter

More Related