Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6192835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:00:48+00:00 2026-05-24T03:00:48+00:00

I have a asp.net website in the umbraco cms, there I can use razor

  • 0

I have a asp.net website in the umbraco cms, there I can use razor templating to create some macros.
I want to integrate a facebook like button in the page,
this works ONLY when I paste the intire iframe in a razor macro and incorporate the macro on my masterpage.

Though, if I want to include some parameters,
and I take the iframe URL out of the code snippet to paste another parameter inside that url
it stops working.

However, after rendering both the iframe url is 100% identical.

Anyone got an idea on how I can make sure that the correct site url is in that Facebook iframe parameter can be changed? (depending on the hostname I bind in the umbraco cms)

Here is my razor code that does not work:

@{
  var currentLangPath = "www.newurl.com"; 
  var iframeSource = "http://www.facebook.com/plugins/like.php?app_id=207125959336150&href=" + currentLangPath + "&send=false&layout=button_count&width=110&show_faces=false&action=like&colorscheme=dark&font=arial&height=21";      
  }

<a href="#visitFanpage"><img src="/images/facebook_logo.jpg" alt="Solex Facebook" /></a>
<p>Become part of the community, and feel free to share your experience.</p>
<div class="social">
  <iframe src="@iframeSource" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:25px;" allowTransparency="true"></iframe>
</div>

Here is the content of a Razor file that does work:

<a href="#visitFanpage"><img src="/images/facebook_logo.jpg" alt="Solex Facebook" /></a>
<p>Become part of the community, and feel free to share your experience.</p>
<div class="social">
  <iframe src="http://www.facebook.com/plugins/like.php?app_id=207125959336150&amp;href=www.newurl.com&amp;send=false&amp;layout=button_count&amp;width=110&amp;show_faces=false&amp;action=like&amp;colorscheme=dark&amp;font=arial&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:25px;" allowTransparency="true"></iframe>
</div>

Note that both these Razor files have EXACTLY the same output, so I find it very weird that the dynamic URL one does not work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:00:49+00:00Added an answer on May 24, 2026 at 3:00 am

    The output isn’t actually the same, the iframeSource variable gets HTML encoded and therefore an “&amp;” turns into:

    &amp;amp;

    You could do two things:

    1. Remove “amp;” after each “&” in the iframeSource
    2. Instead of @iframeSource, use @Html.Raw(iframeSource)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an ASP.NET website that we use internally to do some project tracking
I have a asp.net website folder namely Website3 inside website3 folder there is a
I have an asp.net website that will generate some excel files with 7-8 sheets
I have ASP.NET website, and it calls the asmx web-service to do some operation
I have a asp.net website, which use MVC 1.0 framework, but I found sometimes
I have an asp.net website, where there is no where session is implemented. But
I have an ASP.NET website which is running currently on IIS. Now I want
I have an ASP.NET Website. I want to restrict the Admin Folder to only
I have an asp.net website with a reference to a class library. I can
I have an asp.net website which contains a Thread that fetches some data from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.