0

我必须在我的程序中放置三个不同页面的 Facebook 代码(videoWall.aspx、videoWallDetail.aspx 和 get-involved.aspx)。在头部,我将放置代码并根据需要使用if语句进行更改,检查页面以查看应该使用哪些代码。

如何获取页面 url 或路径或任何我可以用来获取唯一页面的内容?

这是我的代码:

// if(page = videoWall.aspx)
        <meta property="og:title" content="Faces of Metastatic Breast Cancer (MBC) Video Wall" />
        <meta property="og:type" content="cause" />
        <meta property="og:image" content="http://www.facesofmbc.org/images/MBC_Logo.png"/>
        <meta property="og:url" content="http://bit.ly/rkRwzx" />
        <meta property="og:site_name" content="Faces of Metastatic Breast Cancer (MBC)" />
        <meta property="og:description" content="I just viewed the new Faces of Metastatic Breast Cancer (MBC) video wall. For each view, comment or share of the video wall during October, Genentech will donate $1 to MBC initiatives. Watch TODAY!" />
        <meta property="fb:admins" content="653936690"/>

显然我知道if不会那样工作,但这只是我想要做的一个例子,然后重复其他两个实例。

提前致谢!

4

1 回答 1

4

Page.Request.Url.ToString() 将向您显示条目网址...

您可以使用

Page.Request.Url.ToString().Split('?')[0] 仅查看页面...

于 2012-12-12T16:11:48.100 回答