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

Loading a RadWindow from an embedded resource page

6 Answers 145 Views
Window
This is a migrated thread and some comments may be shown as answers.
koffiemokje
Top achievements
Rank 1
koffiemokje asked on 14 Feb 2008, 09:47 AM
Hi Telerik support,

Is it possible to get the memorystream to an embedded aspx page and have that be the page for a RadWindow?

If so, how do I do this?

Thanks in advance,
Vincent

6 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 15 Feb 2008, 09:42 AM
Hi koffiemokje,

You can think of RadWindow in the same manner as for an IFRAME or a browser window (opened with window.open).

The window needs a reference to a URL, and you need to set this URL to its NavigateUrl property.

So, a simple approach whould be to use a regular ASPX page, and send the stream content in its Page_Load method

E.g. in your RadWindow declaration set something like  NavigateUrl = "Stream.aspx?pageid=5"

//In your Stream.aspx do something like
protected void Page_Load(object sender, EventArgs e)
{
    //Determine what content to send back, you can use the GET parameter pageid to determine content
    //if (Request["pageid"] != string.Empty) .... load particular content
    Response.Write(streamContent);
    Response.Flush();
    Response.End();
}




Greetings,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug Beard
Top achievements
Rank 2
answered on 20 Mar 2008, 02:08 PM
What if one wanted to host the ASPX page for the window as an embedded resource in the composit control in which the window resides?

String based URLs to the resources are short on flexibility. 
The window would be far more useful in dynamic environments if the developer could generate the ASPX on the fly and add it to the window or if an embedded resource can be assigned.

I've noticed way too many properties are string based references in the control set.
This leaves control developers in the cold often times.

Do you have plans to implement a more flexible functionality in the future?
0
Tervel
Telerik team
answered on 21 Mar 2008, 12:40 PM
Hello Doug,

I am not sure I understand the question. It seems that you have more of a desktop/WinForms development background, is that correct?

The web-based environment forces a diffeernt programming paradigm, as it clearly separates server-side functionality from client-side functionality. There are also two very distinct environments - the server environment with its APIs and the client browser.

While ASP.NET and other technologies aim to bridge that gap, developing for the web requires to consider how browsers and the protocols they use work.

With this respect, certain features are not possible to implement at all, or in a manner logical for a desktop environment.

In the case of RadWindow, as noted in our original answer - a RadWindow cannot do more than what an IFRAME can do, as it is basically a moveable iframe [when rendered on the client].

We hope this information will be useful to you,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug Beard
Top achievements
Rank 2
answered on 21 Mar 2008, 01:05 PM
Nope, I'm strictly browser dev only.
I've been using your controls at various companies for years, actually.
Every time I join a new organization, I buy your controls...

My main focus with my current position, is custom and composite control development.

Here's the problem.  If a custom control developer wishes to include a Prometheus window (for example) in their control payload, they must also provide a URL to a page to be displayed within the window.  Since they're developing in a Webcontrol derived class their goal would be to encapsulate everything needed for the control, so that the consumer of the control need not create additional pages as companion to this custom control. 

IOW, as a custom control developer, I don't have the luxury of using the window, because I can not encapsulate everything needed to make it work, namely the aspx page to be displayed within the window.

What is needed is the ability to create an embedded aspx page that is held in the assembly, and to use the WebResource class to access it.  This is disallowed, because your property requires a string based URL.  Instead I must go through the pain of creating a virtual host to serve up the embedded resources.

This is just one example I've run into, where the Prometheus controls were not designed with composite control developers in mind.

That's about as clear as mud?  :-)


0
Tervel
Telerik team
answered on 24 Mar 2008, 11:34 AM
Hello Doug,

You can use RadDock to display embedded controls (not aspx-es) - RadDock is similar to RadWindow in the way that it can be moved (and resized - coming in a couple of week) around the page.

As already noted - RadWindow should be used to load fully external pages - just like when using an iframe or window.open.

Since you embed an aspx page, and you want to refer to it on the client, I believe it is still possible to implement - by obtaining the WebResource URL by quering the "system" to return it. If you send us a simple working project using an embedded ASPX page, we will do our best to provide you with a generic mechanism to set a URL to RadWindow by using the name of the embedded page to query the system.



Best regards,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug Beard
Top achievements
Rank 2
answered on 24 Mar 2008, 01:11 PM
I actually thought of that, using the RadDock, but I've had lots of difficulty with the dock working correctly.  I'd have to isolate the problems and send you a project, but essentially the dock doesn't play nice nice with AjaxMgr.

For my current project, I actually used the ToolTip to acheive what I needed to for this particular control.  But a window example would be great.

As soon as I have time, I'll isolate a project and post it.
Tags
Window
Asked by
koffiemokje
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Doug Beard
Top achievements
Rank 2
Share this question
or