How to add a social network to a Web site

Source: Internet
Author: User

This chapter details how to integrate and build social networking services on your site.

In this chapter, you will learn how to add links to sites such as social networking sites, Facebook or Digg, Twitter feeds, Gravatar Avatar, and Xbox player cards to your site.

You will learn:

How to get Social Web bookmarks/Links added to your site.

How to add a Twitter feeds.

How to render a gravatar.com image (avatar).

How to display the Xbox Player card on your site.

How to add a Facebook button to your Web page.

The following is an introduction to the concepts introduced in ASP.net programming in this chapter:

LinkShare Assistant.

Twitter helper.

Gravatar Assistant.

Gamercard Assistant.

Facebook Assistant.

Add links to your site for social networking sites

If your visitors like the information on your site and often want to share it with your friends. People can click on a link in the form of a text (icon) to share content with Digg, Reddit (a social news site), Facebook, Twitter, or similar sites, and in this section you can simply implement this feature. To display these icons or text links, you need to join LinkShare's assistant. People can click on a link when they visit your Web site, share content, and if they have an account for the social network, you can share your site's information with social networking sites and post your links to social networking sites.

1. If you have not yet added the ASP.net Web Helpers library to your site, please add it by referring to the WebMatrix and ASP.net Web page entry.

2. Create a name for page listlinkshare.cshtml and add the following markup to it:

<! DOCTYPE html>

<title>linkshare Example </title>

<body>

Share: @LinkShare. gethtml ("What you want to share.") ")

</body>

In this example, you can share what you want to share as a parameter to the social networking site. Of course, you can customize this parameter.

3. A listlinkshare.cshtml page that runs in a browser. (Make sure this page is in the selected file workspace and then run it again.) )

4. Click on a site's text (icon) link to share your information and link to the page on the social networking site that you selected. For example, if you click the del.icio.us link, you will get your page information to the Save bookmark page of the del.icio.us site.

Add a Twitter feed to your site

Asp. NET Provider accessibility lets you add Twitter feeds to your site, and if you use the Twitter.profile method in your code, you can display a specific Twitter feed on your Web page. If you use the Twitter.search method in your code, you can display results for your Web site based on the specified search content. And this Twitter assistant, width, can be set.

You don't need your account information when you add a Twitter helper to your site, and the information is public.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.