Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • ozgur 2 posts 82 karma points
    Jan 11, 2019 @ 13:29

    i cant display iframe with razor

    hi everyone,

    this code is home.cshtml and it didn't work. in the comment line iframe it's work but I need razor to bring the data. how can i fix this problem?

    <div style="position:relative !important;">
            <!--iframe onload="resizeIframe(this)" scrolling="no" class="SliderMainExternal" src="/slider-partial/slider-part-en.html" style="overflow:hidden;width:100%;margin-top:-75px;"></iframe-->
            <iframe onload="resizeIframe(this)" scrolling="no" class="SliderMainExternal" src="@Html.Raw("/Views/slider.cshtml")" style="overflow:hidden;width:100%;margin-top:-75px;"></iframe>
            <a class="scroll-down" address="true"></a>

    home.cshtml dependencies these

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @inherits UmbracoTemplatePage
        Layout = null;
  • Alex Skrypnyk 5329 posts 19613 karma points MVP 3x admin c-trib
    Jan 14, 2019 @ 16:09
    Alex Skrypnyk

    Hi Ozgur

    The issue is that you do not render the view as HTML, use one of the methods described in this thread -

    You need to render view to pass it as HTML string to an iframe.

    There is nothing with Umbraco in this problem, it's pure razor + html issue.

    Thanks, Alex

  • Alex Skrypnyk 5329 posts 19613 karma points MVP 3x admin c-trib
    Jan 23, 2019 @ 12:44
    Alex Skrypnyk

    Hi Ozgur

    Did you solve the issue? Can you share with our community?


  • ozgur 2 posts 82 karma points
    Jan 29, 2019 @ 14:44

    Hi alex,

    Thank you very much for your help, but this structure (iframe) did not meet my wishes and I blew it up :)

Please Sign in or register to post replies

Write your reply to: