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

Open radwindow with contenttemplate and after change object inside

1 Answer 126 Views
Window
This is a migrated thread and some comments may be shown as answers.
Fabio Cirillo
Top achievements
Rank 1
Fabio Cirillo asked on 10 Jan 2013, 08:55 AM
Hi,
i've created a radwindow with contenttemplate.In this radwindow there's a radasyncupload that i sue for upload image. After this process i want to see the image always in this radwindow. I've two questions:

1) Can i use into radwindow with contenttemplate after process upload the property navigateurl so i load another page where i see the image uploaded.

2) How can to see the image into radwindow after upload process?

Bye 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 11 Jan 2013, 09:24 AM
Hi Fabio,

Once the mode of a RadWindow is chosen it stays in it. You cannot load a page in a RadWindow that already uses its ContentTemplate and vice versa. You can, however, create a new, dynamic instance, by using a RadWindowManager that will load the desired page. You do not even need a postback for this, it can happen on the client-side: http://www.telerik.com/help/aspnet-ajax/window-programming-opening.html.

On previewing images - there is a way to get this done by using an update panel in the content template. Below follows an example, but please note that this is generally a scenario that should be avoided. We are working on allowing the developer to add a preview on the client, so  you may find that useful. Stay tuned and look out for the RadAsyncUplaod demos once the Q1 2013 release is out.

<telerik:RadWindow ID="FirstRw" runat="server" Title="First">
    <ContentTemplate>
        <asp:UpdatePanel ID="Updatepanel1" runat="server">
            <ContentTemplate>
            <telerik:RadAsyncUpload runat="server" ID="rau1" TargetFolder="~/Images"></telerik:RadAsyncUpload>
                <asp:Image ID="Image1" ImageUrl="" Visible="false" runat="server" />
                <asp:Button ID="Button3" Text="Upload File and set to Image" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </ContentTemplate>
</telerik:RadWindow>
Protected Sub rau1_FileUploaded(sender As Object, e As Telerik.Web.UI.FileUploadedEventArgs) Handles rau1.FileUploaded
    Image1.ImageUrl = "~/Images/" & e.File.FileName
End Sub
 
Protected Sub Button3_Click(sender As Object, e As System.EventArgs) Handles Button3.Click
    Image1.Visible = True
End Sub



Regards,
Marin Bratanov
the Telerik team
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 their blog feed now.
Tags
Window
Asked by
Fabio Cirillo
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or