Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I got one example from Google below:

Java script code:
JavaScript
function fbs_click()
     {
     u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
      return false;
     }

Html Code:
HTML
<a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank">Share on Facebook</a>

Below is my question and coding:
I want to transfer the images url to two locations. I did one location for playing video, but another location to social image. I used on the nested repeater for image slider, when the user click on the image, then the video will play, as well as want to send the url to social image.

I used repeater.
HTML
<ItemTemplate>

   <li>

   <img src=' <%#Eval("ImageName") %>' alt='<%#Eval("ImgUrl") %>' width="130" height="100" onclick = "ChangeImage(this)" style="cursor:pointer;" />

   </li>

   </ItemTemplate>

I used Java script code:
JavaScript
function ChangeImage(getID,getfbshare) {
      var targetID = document.getElementById("centralImage");
      targetID.src = getID.alt;

      var targetID1=document.getElementById("getfbshare");
      targetID1.href=getfbshare.alt;
     }

Below the video player one social image is there for sharing current link:
HTML
<a  href="" target="_blank" id="getfbshare" onclick="return fbs_click()><img  src="image/fb.gif" width="30" height="30"> </ a>
Posted
Updated 9-Jul-14 22:20pm
v2

1 solution

Check this out, it is targeting at doing what you require and more with facebook from CSharp, sounds like you may as well get to know the SDK sooner than later to expand your capabilities for versatile features

http://facebookcsharpsdk.codeplex.com/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900