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.

 

 

Published Thursday, July 8, 2010 5:59 AM by shiju
Filed under: ,

Comments

# re: ASP.NET Page Helpers in WebMatrix

Thursday, July 8, 2010 10:42 AM by hajan

Very useful! Thanks for sharing! :)

# re: ASP.NET Page Helpers in WebMatrix

Tuesday, July 13, 2010 12:48 PM by Mark

This seems to be great. I would like to know were i could get a list of all helpers available.

# re: ASP.NET Page Helpers in WebMatrix

Monday, July 19, 2010 4:36 AM by eugene

likewise on the list of helpers. would be great if we can have a list. :D

# re: ASP.NET Page Helpers in WebMatrix

Monday, July 19, 2010 5:06 AM by shiju

@Mark,@eugene - Check out the link www.asp.net/.../asp-net-web-pages-api-reference

# re: ASP.NET Page Helpers in WebMatrix

Wednesday, November 24, 2010 3:33 PM by Anusha

Hi Shiju,

Thanks for the wonderful article It saved lot of my time...

I was wondering is there a way I can Customize UI for Twitter Search say from blue box to some different color, height, width which suits website?

If possible how should I do that?

Thanks in advance,

Leave a Comment

(required) 
(required) 
(optional)
(required)