Loading ...

How to open a pop up window & close it on click of button from another page?

Who is online?  0 guests and 0 members
home  »  forums   »  asp.net topics   »  client side web development   » How to open a pop up window & close it on click of button from another page?

How to open a pop up window & close it on click of button from another page?

Posts under the topic: How to open a pop up window & close it on click of button from another page?

Posted: 9/12/2011

Lurker 245  points  Lurker
  • Joined on: 4/15/2011
  • Posts: 44

I have default.aspx page on which i have opened a telerik rad window


     function openRadWinFreq()

{
        radopen("friendrequest.aspx","RadWindow1");
     
   }

on friendrequest.aspx page having a submit button on which i want to close the rad window after submitting the data.(code behind)

actually i am not able to close the window please help me out


Posted: 9/12/2011

Guru 16773  points  Guru
  • Joined on: 4/19/2009
  • Posts: 490

Hi,

Did you try GetRadWindow().close() 


Posted: 9/12/2011

Lurker 245  points  Lurker
  • Joined on: 4/15/2011
  • Posts: 44

 Hi Raghav,

yes i had, like this way...

on friendrequest.aspx page added this script

<script type="text/javascript">
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }

            function Close()
             {
                GetRadWindow().close();
             }
        </script>

as my submit button has OnClick() event (to save user input) so i had called Close() function at codebehind like

Button1.Attributes.Add("OnCilentClick", "Close()");

but still it dosen't work

is it anything wrong?


Posted: 9/12/2011

Guru 16773  points  Guru
  • Joined on: 4/19/2009
  • Posts: 490

Tell me one thing, when you click the submit button in modal? Does the page does postback?


Posted: 9/12/2011

Lurker 245  points  Lurker
  • Joined on: 4/15/2011
  • Posts: 44

user will enter some message in to the text box & click on the submit button

hense page is post back becoz i have to write code logic to save user message to DB on click of a button

i hope you will understand


Posted: 9/12/2011

Guru 16773  points  Guru
  • Joined on: 4/19/2009
  • Posts: 490

Why don't you send an ajax request and the call the close logic of modal from client side


Posted: 9/13/2011

Lurker 245  points  Lurker
  • Joined on: 4/15/2011
  • Posts: 44

but how? please explain


Posted: 9/13/2011

Guru 16773  points  Guru
  • Joined on: 4/19/2009
  • Posts: 490

pallavi karpe said:

but how?


You don't know how to make an ajax request or you don't know how to close the modal? 


Page 1 of 1 (8 items)