How to Get Image content In Rad Window

2 posts, 0 answers
  1. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 25 Jun 2013 Link to this post


    Hello folks,
    I have requirement like these.I have rad-window inside I have following code .



    <telerik:RadWindow ID="rdwndwPreviewCheck" VisibleOnPageLoad="false" Title="Check Preview">
            <ContentTemplate>
                <table>
                </table>
                <asp:Image ID="chkImage1" runat="server" ImageUrl="~/CheckPreview.aspx" />
                <br />
                <br />
                <table style="width: 100%;">
                    <tr align="center">
                        <td style="width: 580px;">
                            <telerik:RadButton ID="rdPrint" runat="server" Text="  Print"   Style="position: relative;
                                left: 90px;"  OnClick="print"    >
                                <Icon SecondaryIconCssClass="rbPrint" SecondaryIconRight="4" SecondaryIconTop="4" />
                            </telerik:RadButton>
                        </td>
                        <td>
                            <telerik:RadButton ID="CloseRadPrintWindow" runat="server" Text="Close" OnClientClicked="closeMyRadWindow"
                                Style="position: relative; left: -185px;">
                            </telerik:RadButton>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
        </telerik:RadWindow>


    I want to access the  image content  inside the rad-window....through code behind technique  and  I need to assign  that Image  to  some other image .. using the  code behind technique ..after that I want to convert the Image into Byte[] ...here
    the image url is not a static one and it is dynamic based on requesting the page we getting some Image .jpeg from that page.
          <script type="text/javascript">
                function printIt() {
                    var win = window.open('', 'popup', 'location=1,status=1,scrollbars=1,width=800,height=600');
                    if (win) {
                        var imageControl = document.getElementById('<%=chkImage1.ClientID%>').src;
                        win.document.write('<img src="' + imageControl + '">');
                        win.document.close();
                        win.focus();
                        win.print();
                    }
                    return false;
                }
            </script>
    the above code  , I  used to  Display Image in the  ..rad-window..But ..same image I want to access code code behind technique and also I need to convert to Byte[] stream.
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 28 Jun 2013 Link to this post

    Hi Sairam,

    The controls from the RadWindow's ContentTemplate are available directly in the code-behind from the page;s class, as can be seen by examining this demo's code  http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx  and this help article http://www.telerik.com/help/aspnet-ajax/window-controls-container.html.


    Regards,
    Marin Bratanov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top