Programmatically close aspx page from code behind
UPDATE: I have taken all of your input and came up with the following solution:
In code behind:
protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "closePage", "window.onunload = CloseWindow();");
}
In aspx page:
function CloseWindow() {
window.close();
}
closing the aspx page by writing code?
Use javascript to call document.window.close() on the click event. You would need to post code or more details about your platform to provide any more.
Unable to close current window
Try the following link
Programmatically close aspx page from code behind
Based on the scenario it may very. Please read the above thread replies
Also the following link shows the same question
How to close the current tab in the server side button click?
Related Topics
Could Not Start Windows Service, Error 1064
Passing Datetimeoffset as Webapi Query String
C# Download Big File from Server With Less Memory Consumption
How to Get Only Date from a Datetime Value in Razor Page
Redirecting to Another Page in ASP.NET MVC Using Javascript/Jquery
Using X-Alt-Desc/Applying HTML to Calendar Invites in Outlook
How to Use Decimal Type in Mongodb
Pass an Array of Integers to ASP.NET Web API
How to Autosize the Height and the Width of C# Windows Form
How to Determine Browser Window Size on Server Side C#
How Does Httpcontext.Current.User.Identity.Name Know Which Usernames Exist
How to Get Nested Json Values in C#
How to Refresh an Entity Framework Core Dbcontext
What Regular Expression Would I Use to Remove Everything After the Second Backslash
How to Convert HTML to Pdf Using Itextsharp
C# Json.Net How to Ignore a Property in Deserialization But Not in Serialization