Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Close window from codebehind after server-sided action

I tried several ways to fulfill the action: Protected Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click saveLestijden() 'Response.Write(" { window.close(); }") 'Page.ClientScript.RegisterStartupScript(Page.GetType(), "alert", "window.close();", True) 'Page.ClientScript.RegisterOnSubmitStatement(Page.GetType(), "closePage", "window.onunload = window.close();") Page.ClientScript.RegisterOnSubmitStatement(Page.GetType(), "closePage", "window.onunload = window.opener.close();") End Sub

No one is working If this is not possible, is there a way to close the window by for example a button ( also after a postback) I tried : Protected Sub btnTerug_Click(sender As Object, e As EventArgs) Handles btnTerug.Click

    Dim Script As String = "window.close();"
    System.Web.UI.ScriptManager.RegisterClientScriptBlock(btnTerug, Me.GetType(), "Test", Script, True)
End Sub

also nothing works. Before the postback I can close the window, but after savelestijden() the button does not work. PLease help ....

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!