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

Hide window OnClose

1 Answer 64 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike
Top achievements
Rank 1
Mike asked on 26 Jun 2012, 01:01 PM
Wondering if there is Javascript I can use to hide the window after calling the OnClose client-side event. I can close the window. However, when I leave my page and hit the back button in the browser the window opens again. I am trying to see if forcing a hide or .Visible(false) will fix this issue.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 26 Jun 2012, 10:57 PM

I was able to come up with a crude workaround for anyone who has this need. I use the OnClose client event as in:

@{ Html.Telerik().Window()
  .Name("WindowConfirmDemo")
  .ClientEvents(events => events.OnClose("stopConfirm"))
  .Title("Confirmation")

...

I then simply refresh the page in the close function as in:

function stopConfirm() {
  window.location.href = "/";
}

Not great. However, now if the user selects another link and then hits the back button, the modal window does not automatically pop up anymore.

Tags
Window
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Share this question
or