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

[Solved] RadWindow Problem

3 Answers 129 Views
Window
This is a migrated thread and some comments may be shown as answers.
Gourangi
Top achievements
Rank 1
Gourangi asked on 18 Feb 2010, 11:10 AM
I used telerik radwindow but i have 1 problem, actully i close radwindow in my button click but before that i want to see radalert message in codebehind. I call my window close script in my button's client click & inside that script i call ajaxrequest for my codebehind operation. I write code for showing alert message (i.e "  ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Key1", "<script>alert('Confirmed',330,140,'VTS');return false;</script>", true);" ).
Now my situation is without showing alert message it is closed. 


Sadhna Patel

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 18 Feb 2010, 03:55 PM
Hello Sadhna,

I am afraid I could not completely understand what you need to achieve. Can you please provide the following information:

1) What should happen on button click and is this supposed to happen on every button click no matter the alert message?

2) What are the two scenarios, with and without the alert message, please describe what you need to achieve in details.

3) Share some relevant code - the button's handlers, how you open and close the RadWindow, etc

Once I receive the requested information I will get a better understanding on your scenario and I will do my best to help.


Best wishes,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Gourangi
Top achievements
Rank 1
answered on 19 Feb 2010, 05:01 AM
This coding is in my showdialog.aspx page & i call this page in my radwindow but after clicking on my "confirm" button without showing radalert it is closed   

Following is my javascript

        function closeWin()
        {
            //get a reference to the current RadWindow
            var oArg = new Object();
            oArg.Status='Y';
            var oWnd = GetRadWindow();
            oWnd.close(oArg);
        }
        
        function GetRadWindow()
        {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
              
      
    
       function returnToParent() {
           
             //This is ajaxsetting of ajaxmanager i.e inside in my page
             var ajaxManager=$find('<%=ajaxManager.ClientID%>');
             ajaxManager.ajaxRequest();
             
            //create the argument that will be returned to the parent page
             var oArg = new Object();
             oArg.Status='Y';
             var oWnd = GetRadWindow();
             oWnd.close(oArg);
         
        }


Following is my button

 <asp:Button ID="btnSMSToBoth" runat="server" Text="Confirm" Width="120px"  OnClientClick="returnToParent(); return false"                                              />



Folloeing is my codebehind

 protected void ajaxManager_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {

              int iResult = _db.proc_UpdateTripDetails(int.Parse(lblVehicleId.Text), int.Parse(lblDriverId.Text), 'A');

                    if (iResult == 0)
                     {
                              //My alert Message i.e not showing in my radwindow    

                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Key1", "radalert('Confirmed',330,140,'VTS');",
                        true);
                      }
}
0
Svetlina Anati
Telerik team
answered on 24 Feb 2010, 09:55 AM
Hello Divyesh,

I examined your code and I prepared a test demo based on it. However, the RadWindow is always closed because of the code in the returnToParent function - if you comment the lines that close the RadWindow it will stop closing. Note also that since you are using a RadAjaxManager you can inject the script from the server by using the ResponseScripts collection. For your convenience I attached ny test demo - in case I have not completely understand your setup because the provided code was not enough and you did not provide explanations and instructions what is on the main page and what in the content page, modify it correspondingly and provide detailed explanations of the needed modifications and the problem. 


Sincerely yours,
Svetlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
Gourangi
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Gourangi
Top achievements
Rank 1
Share this question
or