GetRadWindow() doesn't work after a response.redirect in window

4 posts, 0 answers
  1. Stuart Hunt
    Stuart Hunt avatar
    2 posts
    Member since:
    Sep 2008

    Posted 21 Aug 2009 Link to this post

    Hi, i'm trying to build a wizard using the RadWindow on page A the GetRadWindow function works fine but once i am done on page A and redirect to Page B it no longer works, i can refactor to use the same page but this is not what i wish to do.

    Stuart.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 21 Aug 2009 Link to this post

    Hi Stuart,

    I am not quite sure that I understand you correctly. Could you please post the code for your pages here?


    Best wishes,
    Georgi Tunev
    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.
  3. Stuart Hunt
    Stuart Hunt avatar
    2 posts
    Member since:
    Sep 2008

    Posted 21 Aug 2009 Link to this post

    ok i'm using jquery to catch all the button clicks so on page A this works

    function GetRadWindow() {  
                var oWindow = null;  
                if (window.radWindow) oWindow = window.radWindow;  
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
                return oWindow;  
            }  
     
    $telerik.$("input[id$='btnCancel']").click(function() {  
                GetRadWindow().Close();  
            }); 
    but on Page B the same function doesn't

    function GetRadWindow() {  
                var oWindow = null;  
                if (window.radWindow) oWindow = window.radWindow;  
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
                return oWindow;  
     
            $telerik.$("input[id$='btnFinish']").click(function() {  
                if ($telerik.$("input[id$='txtAltText_text']").val() != "") {  
                    var imageoriLoc = $("img[id$='imgOriginal']").attr("src");  
                    var imagealtloc = $("img[id$='imgAltered']").attr("src");  
                    var imgAltText = $("input[id$='txtAltText']").val();  
                    var imageloc = imageoriLoc + ',' + imagealtloc + ',' + imgAltText;  
                    $telerik.$.ajax({  
                        type: "POST",  
                        url: "ImageEditp2.aspx/SaveImage",  
                        data: '{ imageLocs:\"' + imageloc + '\" }',  
                        contentType: "application/json; chatset=utf-8",  
                        dataType: "json",  
                        success: function(msg) {  
                            alert("test");  
                            var oArg = new Object();  
                            oArg.UpdateImage = true;  
                            oArg.AltText = $telerik.$("input[id$='txtAltText_text']").val();  
                            alert(oArg.AltText);  
                            oArg.ID = $.query('imageId');  
                            var oWnd = GetRadWindow();  
                            alert(oWnd);  
                            debugger;  
                            if (oArg.UpdateImage && oArg.AltText && oArg.ID) {  
                                oWnd.close(oArg);  
                            }  
                        }  
                    });  
                      
                  
                }  
                else {  
                    var textbox = $find("<%= txtAltText.ClientID %>");  
                    textbox.get_styles().EnabledStyle[1] += " riError";  
                    textbox.get_styles().HoveredStyle[1] += " riError";  
                    textbox.updateCssClass();  
                }  
                return false;  
            }  
            });  
     
     
    the code works till it hits the GetRadWindow() functions and all i'm doing from Page A to Page B in the .cs file is Response.Redirect("~/Page.aspx?id=24");
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Aug 2009 Link to this post

    Hello Stuart,

    I tried to reproduce the problem but to no avail. Please open a support ticket and send me a small sample project where this issue could be observed and I will check it. As an alternative, you could modify the sample attached to this thread.

    Thank you in advance for your cooperation.


    Sincerely yours,
    Georgi Tunev
    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.
Back to Top