Navigate to a new tab and reload the current page

Page.ClientScript.RegisterStartupScript(Page.GetType(), null, "window.open('bill_invoice.aspx?Number=" + txt_billNo.Text + "', '_blank')", true);

This is a new tab for the bill invoice.

Page.ClientScript.RegisterStartupScript(Page.GetType(), null, "window.open('customerRegistration.aspx', '_self')", true);

This is the old page that needs to be refreshed.

The new page opens in a new tab, but the old page cannot be refreshed or opened in the same tab.

Answer №1

Here is a helpful tip for refreshing the page:

If you need to redirect on the same page, you can use the following code:

Response.Redirect(Request.RawUrl);    

If you prefer to refresh the page on the client side rather than the server side, you can use:

 javascript:document.location.reload() 

Alternatively, you can also use:

window.location.href= window.location; 

You can find more information on how to achieve this by visiting the link below:

http://forums.asp.net/t/1310604.aspx?+How+to+refresh+the+page+programatically+by+C+

Answer №2

Perform the following action...

Invoke a javascript function as shown below...

var windowObjectReference;

function launchPopup() {
    windowObjectReference = window.open("CMS_1.aspx",
          "DescriptiveWindowName",
          "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
}

This code snippet will open the page in a new tab, and at the end of the function, you need to reload the location....

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using VueMultiselect with Vue 3: A guide for beginners

I'm currently experimenting with the vue multiselect component, but when I include it in the template, I am encountering a series of warnings and errors. <script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email ...

The input type '{}' does not match the expected type 'Readonly<IIdeasContainerProps>'. The property '...' is not found in the type '{}'

Having recently started using TypeScript, I'm encountering some issues when attempting to execute this code snippet. Error The error message reads as follows: Failed to compile 13,8): Type '{}' is not assignable to type 'Readonly &l ...

Enhance Your HTML Skills: Amplifying Table Display with Images

Recently, I utilized HTML to design a table. The Table Facts : In the first row, I included an appealing image. The second row contains several pieces of content. In continuation, I added a third row. The contents in this row are extensive, resulting i ...

HTML mandatory field not functioning effectively

I am currently experiencing issues with the required validation in my HTML form. It is not functioning as intended. I have two buttons on a single page and I would like for one button to validate textbox1 upon click, while the other button should validate ...

Oops! There seems to be an issue with trying to access the 'map' property of undefined within the render method

While working on my project, I encountered an issue with a table from react material ui. The problem arises when attempting to populate the table with data from the state, resulting in an error message stating "cannot read property 'map' of undef ...

Mozilla's client-session data is not persisting

Despite my efforts, the sessions are not persisting between calls. Although similar questions have been asked before, the solutions provided do not address my specific issue. Here is a snippet of the server code: var express = require('express' ...

Incorporating a new dropdown menu above the content of a pre-existing jQuery accordion dropdown, causing the content to shift downwards

Seeking a way to overlay a second-level dropdown menu on top of the content beneath a jQuery accordion-style dropdown. Typically, the jQuery accordion pushes down the content below, but I want the second-level dropdown to remain unaffected. Is there a solu ...

An issue of an infinite loop arises when utilizing the updated() lifecycle hook in VueJS

I am working on a VueJS application where I need to fetch a list of articles in one of my components. The logic is such that if the user is logged in, a specific request is made, and if not, another request is executed. Below is the snippet of code: <s ...

Tips for passing an object variable as an argument in C#

I need to calculate the total of an integer argument from multiple lists within a class. These lists contain the same variables, and I'm looking for an efficient way to refer to each list and add its values to a total without using many nested loops. ...

Creating HTML elements using JavaScript

Below is the code snippet in question: function getAllRecipes(){ $.ajax({ type: "GET", url: "https://api.npoint.io/7493fda05b8038212eed", beforeSend: function() { $("#AllRecipe").html('Fetching...') }, success: func ...

Steps for launching Angular 5 application using Node.js server

I have developed an Angular 5 application that retrieves data from a node.js server. I successfully deployed the application to my web server hosted by FastComet, which supports node.js, but unfortunately, the server does not seem to be functioning properl ...

Using jQuery to store the name of a Div in a variable and subsequently invoking it in a function

Recently, I've been grappling with a task involving storing a div name in a variable for easier editing and incorporating it into standard actions like show/hide. My code functions perfectly without the variables, but introducing them causes the div ...

Unexpected behavior encountered when using the $http.post method

I've been working with a component that I utilized to submit data to the Rest API. The code snippet for the component is as follows: (function(angular) { 'use strict'; angular.module('ComponentRelease', ['ServiceR ...

What is the correct method for executing an API request within a div?

I am currently facing a challenge in displaying data in a table sourced from 2 different tables in my database, connected by foreign keys. To retrieve the list of stores, I use the following code snippet: useEffect(()=>{ axios.get("http://localhos ...

Performance problem with 'Point-along-path' d3 visualization

I recently explored a d3 visualization where a point moves along a path, following the code example provided at https://bl.ocks.org/mbostock/1705868. During this movement, I observed that the CPU usage ranges from 7 to 11%. In my current project, there ar ...

A step-by-step guide to implementing bubble sort for sorting a 2D array in JavaScript

Here's a function that requires modification to work with a 2D array: function sortTwoDimensionalArray(arr) { var numRows = arr.length; for (var i = 0; i < numRows; i++) { for (var j = 0; j < (numRows - i - 1); j++) { if(arr[j][ ...

Need help with checking for the presence of a value in a multidimensional array using Node.js/Javascript?

Imagine you have an array structured like this: $game = Array ( ['round'] => Array ( ['match'] => Array ( ['player_2'] => Array ( ...

Encountering issues with initializing a member using Constructor within WCF

In my CibilResponse Class, I have properties that are of a class type (TUEF class). When trying to assign values using : CibilEnquiryEnq.Tuef.Version = "12";, I encountered a null reference error. To resolve this issue, I had to create an object like : Ci ...

What is the best way to send data between pages in a React application?

After solving the question, I can confirm that the code lines are correct. By utilizing console log, I verified that all parameters are being passed correctly: I am creating a website to showcase my personal projects, using components across different pag ...