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.

 

 

5 Comments

Comments have been disabled for this content.