The Web simplified via Web Matrix

If you’ve not noticed the slew of blog posts and comments in the online world on the new products Microsoft has release you better get up to speed. Web Matrix and especially the new helper classes in ASP.Net enable adding social media elements into your website very easily.

What is WebMatrix

“WebMatrix is everything you need to build Web sites using Windows. It includes IIS Developer Express (a development Web server), ASP.NET (a Web framework), and SQL Server Compact (an embedded database). It streamlines Web site development and makes it easy to start Web sites from popular open-source apps. The skills and code you develop with WebMatrix transition seamlessly to Visual Studio and SQL Server.” Source  – http://www.microsoft.com/web/webmatrix/

I would recommend you read these four posts on ScottGu’s blog …

  1. Introducing WebMatrix
  2. Introducing “Razor” – a new view engine for ASP.NET
  3. New Embedded Database Support with ASP.NET

  4. Introducing IIS Express

Getting Social easily

Some interesting new helper classes in the ASP.Net API help you to integrate social elements in your website quite easily.

Here are some of the classes in the API which I’m going to explore…

1. Twitter.Profile(twitterUser) – Renders a Twitter stream for the specified user. e.g. @Twitter.Profile("billgates") –

2. Twitter.Search(searchText) – Renders a Twitter stream for the specified search text. e.g. @Twitter.Search("asp.net")

3. Link sharing –

LinkShare.GetHtml(title)
LinkShare.GetHtml(title, url)

Renders social networking links using the specified title and optional URL.

e.g.

@LinkShare.GetHtml("ASP.NET Web Pages Samples")
@LinkShare.GetHtml("ASP.NET Web Pages Samples", http://www.asp.net)

4. Gravatar and Gamecard.

GamerCard.GetHtml(gamerTag)

Renders the specified Xbox gamer tag.

e.g. @GamerCard.GetHtml("joe")

Gravatar.GetHtml(email)

Renders the Gravatar image for the specified email address.

e.g. @Gravatar.GetHtml("joe@contoso.com")

5. Facebook Like Button – Facebook.LikeButton(url) – Lets Facebook users make a connection to pages. e.g. @Facebook.LikeButton(www.ASP.net)

6. There are two others which I’m not sure exactly how they function, I need to try them out not exactly social however, related to Analytics – Google and Yahoo

Analytics.GetGoogleHtml(webPropertyId)

Renders the Google Analytics JavaScript code for the specified ID.

@Analytics.GetGoogleHtml("MyWebPropertyId")

Analytics.GetStatCounterHtml(project, security)

Renders the StatCounter Analytics JavaScript code for the specified project.

@Analytics.GetStatCounterHtml(89, "security")

Analytics.GetYahooHtml(account)

Renders the Yahoo Analytics JavaScript code for the specified account.

@Analytics.GetYahooHtml("myaccount")

Advertisements

About sanjayshetty

Sanjay Shetty is currently putting the finishing touches on his book, the Brand Advocacy quick start guide, which covers his framework for building a brand advocacy program. He blogs at http://www.sanjayshetty.com
This entry was posted in Web Matrix. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s