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

Is it possible to get Dialog.aspx

1 Answer 179 Views
Window
This is a migrated thread and some comments may be shown as answers.
k f
Top achievements
Rank 1
k f asked on 04 Oct 2007, 05:45 PM
Used in the following example.  Trying to follow the example but wondering what I'm missing from that file that makes it return data back to the page that opened the window.

Example is at:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Window/Examples/DialogReturnValue/DefaultCS.aspx

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 05 Oct 2007, 05:21 AM
Hi k f,


You can find below the code for that page. It is a simple Html and there is no codebehind for it. If you have installed the RadControls "Prometheus" suite, the Dialog.aspx file is available in your
C:\Program Files\telerik\RadControls 'Prometheus' for ASPNET Q2 2007\Live Demos\Window\Examples\DialogReturnValue folder.

<html> 
    <head><title>  
    Dialog  
</title>          
        <style> 
          
        *  
        {  
            font: normal 11px Arial, Verdana, Sans-serif;         
        }  
                  
        .bButton  
        {  
            width: 100px;  
            height: 20px;  
            border: 1px;  
            background-image: url(../bBtuttonBg.gif);  
            background-repeat: no-repeat;  
            background-color: #fff;           
            color: #666666;  
            vertical-align: middle;  
        }                 
        </style> 
    </head> 
    <body onload="ConfigureDialog()">  
        <form  method="post" action="Dialog.aspx?rwndrnd=0.9340661230008723" id="Form1">  
<div> 
<div><input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGQYc4E0Z46D6xzjFv4tH3xVekRc2w==" /></div>  
</div> 
 
        <script type="text/javascript">  
            //This code is used to provide a reference to the radwindow "wrapper"  
            function GetRadWindow()  
            {  
                var oWindow = null;  
                if (window.radWindow) oWindow = window.radWindow;  
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
                return oWindow;  
            }         
              
            function ConfigureDialog()  
            {  
                //Get a reference to the radWindow wrapper  
                var oWindow = GetRadWindow();  
                  
                //Obtain the argument   
                var oArg = oWindow.Argument;  
                  
                //Use the argument  
                var oArea = document.getElementById("DialogInfoArea");  
                oArea.value = oArg.TextValue;  
                oArea.style.color = oArg.Color;  
                oArea.style.backgroundColor = oArg.BackColor;                     
            }  
                          
            function OK_Clicked()  
            {  
                var oWindow = GetRadWindow();  
                  
                //Get current content of text area  
                var oNewText = document.getElementById("DialogInfoArea").value;  
                alert ("Text to be returned to main page: " + oNewText);  
                  
                //Variant1: Passing the argument to the close method will result in the same behavior  
                oWindow.close(oNewText);  
                  
                //Variant2: Invoke the calback function, pass it the result as an argument  
                //oWindow.CallBack(oNewText);  
                                          
                //Variant3: Possible to set the Argument property of RadWindow here, and read it in the OnClientclose event handler!  
                //oWindow.Argument = oNewText;            
            }  
              
            function Cancel_Clicked()  
            {  
                var oWindow = GetRadWindow();             
                oWindow.close();  
            }                 
        </script>     
    
        Text from main page (possible to change):  
        <br/><textarea id="DialogInfoArea" rows="5" cols="38"></textarea> 
        <br/>         
        <button onclick="OK_Clicked(); return false;" class="bButton">OK</button> &nbsp;&nbsp;        
        <button onclick="Cancel_Clicked(); return false;" class="bButton">Cancel</button>     
        </form> 
    </body> 
</html> 
 


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
k f
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or