in

Chennai .Net User Group

A platform that enables you to Learn, Share & Grow (India's first .Net user group)

Shiju Varghese's Blog

ASP.NET Page Helpers in WebMatrix

 The new WebMatrix beta is providing set of HTML helpers that can be use for common web site tasks. The below ASP.NET page within the WebMatrix is using some HTML helpers for integrating social networking web site features.

 

<!DOCTYPE html>

<html>

    <head>

         <title>Helpers Demo</title>

    </head>

    <body>      

     <table>    

     <tr>

        <td>Twitter Profile helper</td>

        <td>Twitter search helper</td>

      </tr>

      <tr>

        <td>@Twitter.Profile("shijucv")</td>

        <td>@Twitter.Search("asp.net mvc")</td>

      </tr>

    </table> 

    <p>

    @Gravatar.GetHtml("shiju.varghese@gmail.com", 50)

    </p>

    <p>

     @LinkShare.GetHtml("LinkShare","http://weblogs.asp.net/shijuvarghese")

    </p>

   <p>

    @Facebook.LikeButton("http://weblogs.asp.net/shijuvarghese")

   </p>

    </body>

</html>

 

 

 The @ character is part of the new Razor syntax that represents the server-side code. In the above code block, we have added five HTML helpers on the ASP.NET web page. The Twitter.Profile would provide a twitter feed for a given user name and the Twitter.Search would provide twitter search for a text. The Gravatar helper can be use to render a Gravatar image for a account name. The  LinkShare.GetHtml helper can be use to render link share buttons for the major social networking web sites. The Facebook.LikeButton would provide a facebook like button for a given page link.

The below screen shot is shown the output of the above ASP.NET page.

 

 

Read the complete post at http://feedproxy.google.com/~r/ShijuVBlog/~3/ozP7jW3jmRI/asp-net-page-helpers-in-webmatrix.aspx

Only published comments... Jul 08 2010, 12:59 PM by Shiju Varghese's Blog
Filed under: ,
Copyright © 2002-2008 Chennai .Net User Group. All Rights Reserved. Microsoft and Microsoft logo's are trademarks of Microsoft Corporation