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

radWindow within user controls

2 Answers 197 Views
Window
This is a migrated thread and some comments may be shown as answers.
Steven Black
Top achievements
Rank 1
Steven Black asked on 19 Jul 2009, 02:19 PM

I have a usercontrol called "uc_Email.ascx" and I have a corresponding edit page called "EditEmail.aspx".  When the user clicks an Add button or an Edit button from within the email grid in the user control, the EditEmail.aspx page opens up in a radWindow.  Therefore I have a RadWindowManager within my user control.

I have another user control that basically does the same thing, except it's for managing phone numbers instead of email addresses.

Both of these user controls are contained within one parent page (which happens to be a content page within a nested master page), and thus when the page is rendered there are two RadWindowManagers.

My problem is that I can't get either user control to look at the specific "Window" that I'm trying to reference.  For instance, my ShowDialog function takes two parameters - the URL and the name of the Window.  The URL is being opened just fine, but it's using the settings from my radWindowManager and not the settings from the specific Window.

I tried a few different things:

1.  First I tried having my javascript functions (ShowDialog, OnClientClose, etc.) contained within each of my user controls, and also both user controls had their own RadWindowManagers.  The windows are opening up, but they are not using the specific settings from the Window that I am referencing.  They are also both using the settings from one of the two radWindowManagers (i.e. the user control for phone numbers is using the settings from the radWindowManager that's on the user control for emails.).  I did a simple test by changing the Title property of the radWindowManager.

 

2.  Then I tried moving my javascript functions into a .js file and linking that file to my parent page (the functions are identical) so that they would only be rendered once.  I also tried putting my RadWindowManager into my parent page as well. 

 

3.  I then tried moving my javascript functions into my main master page and putting the radWindowManager into my master page as well.  That still didn't work. 

#2 and #3 didn't work at all - I'm getting an "object doesn't support this property or method".

I was wondering if you had any insight as to how to handle this type of scenario - namely multiple user controls on a content page of a nested master page, each with it's own need for a radWindow.

Thanks in advance.

Steve

2 Answers, 1 is accepted

Sort by
0
Steven Black
Top achievements
Rank 1
answered on 20 Jul 2009, 02:27 PM
No need to worry about this one.  I was able to figure it out.

I think I must have had a corrupt RadWindowManager, because I ended up removing the managers and adding them back again and everything seems to be working fine now.

One other change I made though was that now I am opening up my radWindows from my code-behind instead of specifically creating them at design time. 

Everything is working fine.

Thanks.
0
Fiko
Telerik team
answered on 22 Jul 2009, 12:17 PM
Hello Steven,

We are glad that you were able to find a solution yourself.
Having other questions, please feel free to ask us.

All the best,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Steven Black
Top achievements
Rank 1
Answers by
Steven Black
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or