Set window content via JS

2 posts, 0 answers
  1. Nik
    Nik avatar
    51 posts
    Member since:
    Sep 2009

    Posted 14 Sep 2011 Link to this post

    Is there any way I can open a rad window with JS that would show the contents of a html coded JS string, instead of directing it to a URL?
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 15 Sep 2011 Link to this post

    Hello Nik,

    You could used the ContentTemplate of the RadWindow and add a div that you can then populate using JS. Like so:

    <telerik:RadWindow id="RadWindow1" runat="server">
         <ContentTemplate>
              <div id="windowContent">
              </div>
         </ContentTemplate>
    </telerik:RadWindow>

    Your JS would then be something like this:

    document.getElementById("windowContent").innerHTML = "<strong>bolded text</strong>";

    I hope that helps.
Back to Top