第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將 AdSense 代碼添加到我的 ASP.NET MVC 網(wǎng)站?

如何將 AdSense 代碼添加到我的 ASP.NET MVC 網(wǎng)站?

C#
函數(shù)式編程 2022-12-31 10:30:09
我正在為我的網(wǎng)絡(luò)應(yīng)用程序設(shè)置 AdSense。我得到了一個 AdSense 代碼,可以粘貼到我網(wǎng)站的 HTML 中的 和 標記之間。但是我在網(wǎng)站上使用 ASP.NET MVC。請問,如何在我的網(wǎng)站上使用此 AdSense 代碼?<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><script>   (adsbygoogle = window.adsbygoogle || []).push({   google_ad_client: "ca-pub-5888633898042518",   enable_page_level_ads: true });</script>
查看完整描述

2 回答

?
蝴蝶不菲

TA貢獻1810條經(jīng)驗 獲得超4個贊

只需將它添加到您的_Layout.cshtml文件中,在 head 標簽上。



查看完整回答
反對 回復 2022-12-31
?
有只小跳蛙

TA貢獻1824條經(jīng)驗 獲得超8個贊

在 razor AdsComponent 中是這樣的。


<h3>AdsComponent</h3>

<div>

    @Ads

</div>

@code {

    private RenderFragment Ads

    {

        get

        {

            RenderFragment form = b =>

            {

                b.OpenElement(0, "script");

                b.AddAttribute(0, "async", true);

                b.AddAttribute(0, "src", "https://pagead2/googlesyndication.com/pagead/js/adsbygoogle.js");

                b.CloseElement();

                b.OpenElement(0, "ins");

                b.AddAttribute(0, "class", "adsbygoogle");

                b.AddAttribute(1, "style", "display:inline-block;width:728px;height:90px");

                b.AddAttribute(2, "data-ad-client", "ca-pub-988649660289431");

                b.AddAttribute(3, "data-ad-slot", "4069520508");

                //Test

                b.AddAttribute(4, "data-adtest", "on");


                b.CloseElement();

                b.OpenElement(0, "script");

                b.AddContent(0, "(adsbygoogle = window.adsbygoogle || []).push({});");

                b.CloseElement();

            };

            return form;

        }

    }

}


查看完整回答
反對 回復 2022-12-31
  • 2 回答
  • 0 關(guān)注
  • 92 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號