Presentation is loading. Please wait.

Presentation is loading. Please wait.

Learning WebMatrix Part 3 of 3 Akber Alwani

Similar presentations


Presentation on theme: "Learning WebMatrix Part 3 of 3 Akber Alwani"— Presentation transcript:

1 Learning WebMatrix Part 3 of 3 Akber Alwani http://twitter.com/epdotnet

2 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 Agenda

3 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 Why Build Helpers?

4 Build a Helper: The 3 Approaches @helper syntax using CSHTML For simple helpers Use Inline Code Static class with Static methods For helpers that use.NET Framework Use a Class (Intermediate) Requires Visual Studio 2010 for development For complex helpers that require testing Use an assembly (DLL) (Advanced)

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

6 @helper Easy to create HTML shortcuts Wrap commonly used HTML Takes parameters Real example: Facebook Social Plugins Building Helpers – inline syntax @helper HelloWorld(string name = "") { Hello @name } @helper HelloWorld(string name = "") { Hello @name } @helper ShowLoginButton(string buttonText = "") { @buttonText } @helper ShowLoginButton(string buttonText = "") { @buttonText }

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

8 BUILDING HELPERS Demonstration

9 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 Why use Open Source Apps?

10 WebMatrix builds on the success of the Web Platform Installer 2.5 Million Apps downloaded so far WebMatrix and OSS Apps Web Platform Installer WebMatrix Download Install (inc. dependencies) Customize SEO Analysis Publish

11 INSTALL A WEB APP Demonstration

12 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 Publishing your website

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

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

15 PUBLISHING YOUR WEBSITE Demonstration

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

17 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 Growing Your App

18 GROWING YOUR APP Demonstration

19 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 Recap

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

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


Download ppt "Learning WebMatrix Part 3 of 3 Akber Alwani"

Similar presentations


Ads by Google