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

Sharepoint HttpModule - dynamic RadWindow

3 Answers 43 Views
Window
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 23 Sep 2008, 12:26 PM
I've written a HttpModule for sharepoint and need to open a RadWindow. I've proven that the HttpModule injects controls to the page by simply adding a dynamic label.

Here's the code I'm trying to use on the PreInit event in the HttpModule:

        private void Page_PreInit(object sender, EventArgs e)  
        {  
            Page page = HttpContext.Current.CurrentHandler as Page;  
            HttpContext oContext = HttpContext.Current;  
            SPContext oSPContext = SPContext.GetContext(oContext);  
 
            SPWeb oWeb = oSPContext.Web;  
 
            int intMill = DateTime.Now.Millisecond;  
            RadWindow RadWindow1 = new RadWindow();  
            RadWindow1.Skin = "Default";  
            RadWindow1.ID = "test" + intMill.ToString();  
            page.Master.Controls.Add(RadWindow1);  
        }  
 

A label control works fine but I can't get the RadWindow to appear. I've debugged it and saw no exceptions and no errors are generated.

Any ideas?

cheers,

Steve

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 23 Sep 2008, 03:17 PM
Hi Steve,

As far as I understood you want to add and show the RadWindow from the code behind. Your code seems to be correct, except for the fact that you have missed to set the RadWindow's VisibleOnPageLoad property to true. Please, add the follwoing line before adding the RadWindow to the form:

 RadWindow1.VisibleOnPageLoad = true


Best wishes,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve
Top achievements
Rank 1
answered on 23 Sep 2008, 03:39 PM
Hi Svetlina -

Unfortunately, this hasn't helped. In fact I already tried that. The RadWindow doesn't appear, although there are no exceptions when I debug the HttpModule.

Would it be better if I opened a ticket and sent you my solution so you can test for yourself?

cheers,

Steve
0
Svetlina Anati
Telerik team
answered on 25 Sep 2008, 03:32 PM
Hi Steve,

Would you please try adding the RadWindow not to the MasterPage but to the current placeholder's form as shown below:

 
        RadWindow wnd = new RadWindow();  
        wnd.VisibleOnPageLoad = true;  
        this.Form.Controls.Add(wnd); 

I tested this code on my side and it worked as expected.

In case this does not help, please replicate your scenario in a sample AjaxEnabledWebSite, open a new support ticket and send me your demo along with your explanation. Once I receive it, I will do my best to help.

Sincerely yours,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Steve
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Steve
Top achievements
Rank 1
Share this question
or