This is a migrated thread and some comments may be shown as answers.

How to Get Image content In Rad Window

1 Answer 198 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sairam
Top achievements
Rank 1
Sairam asked on 25 Jun 2013, 02:55 PM

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.

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 28 Jun 2013, 08:36 AM
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.
Tags
General Discussions
Asked by
Sairam
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or