css inside RadMultiPage RadPageView impacts whole page

4 posts, 0 answers
  1. Stephen
    Stephen avatar
    3 posts
    Member since:
    May 2012

    Posted 14 Apr 2014 Link to this post

    We have a MultiPage in part of our app, it's essentially an email preview here:
    <code> 
    <telerik:RadPageView ID="RadPageView1" runat="server" Visible="true">
                            <div id="divHTMLContent" runat="server">
                                </div>
                        </telerik:RadPageView>
                        <telerik:RadPageView ID="RadPageView2" runat="server" Visible="true">
                            <div id="divPlainText" runat="server">
                                </div>
                        </telerik:RadPageView>
    </code>

    The problem arises that the HTML Content can contain styles, such as
    <code>
    <style type="text/css">    
     body      {      
          background-color: #efefef;
          color: #777777;
          font-face: Garamond !important;
          }
    </style>
    </code>

    (deliberately chosen to demonstrate the effects)

    These global styles are indeed global. In another context, I was able to <ol><li>introduce an iframe <li>HTMLEncode the content and <li>use jQuery to load the iframe at render time</ol> Any suggestions on how to get similar behaviour?



  2. Magdalena
    Admin
    Magdalena avatar
    421 posts

    Posted 17 Apr 2014 Link to this post

    Hello Stephen,

    I would like to clarify that after I reviewed the provided code I did not notice any iframe element. Please find attached a sample project that includes two RadPageView controls and the provided styles. Could you please explain how to go further with your scenario in order to replicate the issue you are facing?

    It will be very helpful if you modify the attached project and send it back to us for further investigation. Since this a forum thread the attachments are not allowed I would suggest opening a new support thread where you are able to attach the project files.



    Looking forward to your reply.

    Regards,
    Magdalena
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stephen
    Stephen avatar
    3 posts
    Member since:
    May 2012

    Posted 25 Apr 2014 in reply to Magdalena Link to this post

    I said "in another context I introduced an iframe" - I can't see how to do that trick here so I need another approach.
  5. Ivan Zhekov
    Admin
    Ivan Zhekov avatar
    539 posts

    Posted 01 May 2014 Link to this post

    Hello,

    In HTML5 there is a "scoped" attribute defined for the style element and what it does is to apply the styles only to the container of the style element.

    But, that's and attribute that is fairly new and not all browsers support it, which in terms mean that some browsers will be OK and other wont.

    Regards,
    Ivan Zhekov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top