My web site have facility to share 2 thing on Facebook
Share web site(with site logo and some thing about website) on Facebook and
Share question answer(with site logo and question answer) from the list of these on Facebook.
When i will share a question answer from my web site on Facebook than its work fine it would share that question answer.But if i will share again that already share question form Facebook that time it share the web site(with logo and some thing about website).
My code to share on FB:-
function shareOnFacebook(question, answer, id, url, appkey) {
FB.init({
appId: appkey,
});
var logourl = url + '/Resources/image/logo.png';
if (id == 0) {
LinkUrl = url+'/home/home.aspx';
}
else {
LinkUrl = url + '/patient/questiondetails.aspx?questionid=' + id;
}
FB.ui(
{
method: 'feed',
name: unescape(question),
description: (
unescape(answer)
),
link: LinkUrl,
picture: logourl
},
function (response) {
if (response && response.post_id) {
alert('Post was published.');
} else {
alert('Post was not published.');
}
});
}
Anyone know why this is happening
Guys i found solution for my own question it is as followed
On questiondetails.aspx page load i need to dynamically update og:title and og:description meta tag as which question is selected.
First time when i share then it share by FB.ui method so it take title and description from javascript but when it share from Facebook that time it take title and description from meta tag and before this solution Facebook take meta tag from master page, that content web site name as title and description of web site as description.