在asp.net中为我的网站创建facebook分享按钮 [英] create facebook share button for my website in asp.net

查看:87
本文介绍了在asp.net中为我的网站创建facebook分享按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为新闻网站创建一个项目,我需要在facebook上连接新闻。我在google中尝试了很多facebook分享代码,但我无法得到正确的结果。

i现在有了来自一个网站的代码(即)

 <% 
PageLink = http://thamizharnadu.com/view.asp?view=& request( view
iFrameCode = < iframe src ='http://www.facebook.com/plugins/like.php?href =& PageLink& & layout = standard& show-faces = true& width = 160& action = like& font = tahoma& & _
colorscheme = light'rolling ='no'frameborborder ='0' allowTransparency ='true'style ='border:none; overflow:hidden; width:160px; height:90px'>< / iframe>
%>

<%
response.write(iFrameCode)
%>





但我得到了[;预期的错误]



任何人都可以建议我一个正确的代码..请我尝试一个多星期。请帮我拿一个代码。



我的链接是动态的。

解决方案

创建javascript  function  



function renderFbLike(){
< span class =code-keyword> var PageLink = set page link;
var parent = document .getElementById(' fblikediv');
var child = document .getElementById(' fblikeimg');
parent.removeChild(child);

var html2 = < iframe src = \http://www.facebook.com/plugins/like.php?href= + PageLink + < span class =code-string>& send = false& layout = standard& width = 225& show_faces = false& font = arial& colorscheme = light& action = like& height = 35 \scrolling = \ no \frameborder = \0 \style = \border:none;溢出:隐藏;宽度:250像素;身高:35px; \allowTransparency = \true \>< / iframe>;

document .getElementById(' fblikediv')。innerHTML = html2;
}





下载图片fb-like-button.png并提供img的路径src 
aspx页

< pre lang = xml > < div id = < span class =code-keyword> fblikediv style = width:930px; margin:auto; >
< img src = images / fb-like-button.png id = fblikeimg onMouseOver = return renderFbLike(); > < / div >
< div class = internal-container >





可能会帮助你

I am creating a project for news website and i need to connect the news in facebook.i tried so many facebook share codes given in google but i couldn't get correct result.
i now have code from one website (i.e)

<%
PageLink="http://thamizharnadu.com/view.asp?view=" & request("view")
iFrameCode="<iframe src=’http://www.facebook.com/plugins/like.php?href=" & PageLink & "&layout=standard&show-faces=true&width=160&action=like&font=tahoma&" &_
"colorscheme=light’ scrolling=’no’ frameborder=’0′ allowTransparency=’true’ style=’border:none; overflow:hidden; width:160px; height:90px’></iframe>"
%>

<%
response.write(iFrameCode)
%>



but i am getting [; expected error]

can anyone suggest me a correct code..Please i am trying it for more than one week.Kindly help me to get a code.

my link is dynamic .

解决方案

create javascript function 



  function renderFbLike() {
            var PageLink="set page link"; 
            var parent = document.getElementById('fblikediv');
            var child = document.getElementById('fblikeimg');
            parent.removeChild(child);

           var html2 = " <iframe src=\"http://www.facebook.com/plugins/like.php?href=" +PageLink + "&send=false&layout=standard&width=225&show_faces=false&font=arial&colorscheme=light&action=like&height=35\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:250px; height:35px;\" allowTransparency=\"true\"></iframe>";

         document.getElementById('fblikediv').innerHTML = html2;
        }



download image fb-like-button.png and give path to img src
aspx page 

<pre lang="xml"><div id="fblikediv" style="width:930px; margin:auto;">
                        <img src="images/fb-like-button.png" id="fblikeimg" onMouseOver="return renderFbLike();"></div>
   <div class=" internal-container">



May Be it will help You


这篇关于在asp.net中为我的网站创建facebook分享按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆