Is there a way to refresh a different webpage within the current session?

In the world of Asp.Net 4, there is a form waiting to be filled with numeric data by the customer. However, this task can sometimes prove tricky as customers may struggle to calculate and input the total figure for each of the four fields.

An innovative solution is being considered - the addition of a calculator link that would lead the customer to another page where they can input all the minor numbers to find the total. The challenge lies in enabling them to save the total figures and then transfer them back to the original page seamlessly.

The possibility of using Ajax/javascript or sessions to keep track of the figures has been pondered, but uncertainty lingers.

If you have any insights on how this can be achieved, your guidance would be greatly appreciated.

Answer №1

How about this idea?

  • Saving the values to the Session and then refreshing the parent window when closing the child window (the calculator). More details on this can be found in a related question. You can use the code provided in that question:

To open the window:

window.open("foo.html","windowName", "width=200,height=200,scrollbars=no");

To refresh the parent form from the child window:

 <script>
       window.onunload = refreshParent;
       function refreshParent() {
           window.opener.location.reload();
       }
 </script>
  • Alternatively, you could also skip using the Session and directly set the values from JavaScript in your child form. After opening the child window with window.open();, consider implementing something like the following:

    <script language="javascript">  
        function UpdateParent() 
        { 
            window.opener.document.getElementById('MyControl').value="New Value"; 
        } 
    </script> 
    

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

Oops! Hardhat Test Error "Error: Virtual Machine Exception occurred while processing transaction: reverted with reason 'Please deposit additional funds'."

Encountering an issue with the following error message: Error: VM Exception while processing transaction: reverted with reason string 'deposit more' in the Hardhat Test.js file Test.js -> it("should be able to withdraw if no one appl ...

Error encountered: "Invalid keyword 'using' while attempting to insert a new record into Smartsheet."

Welcome, **I am a beginner when it comes to REST and JSON, but I am attempting to set up C# code to add new rows to a SmartSheet through the API. After testing this in POSTMAN, I received the response shown below. Can anyone point out what I might be miss ...

What is the best way to retrieve ul li values using AngularJS?

I am looking to extract the content of li elements within a ul element in an AngularJS controller and save them into an array. Sample HTML Code: <ul id="list" my-directive> <li>A</li> <li>B</li> <li>C ...

Discovering which chip has wrapped to the next line in Material UI Autocomplete can be found by closely inspect

Currently, I am working with a Material UI autocomplete feature that functions as follows: https://i.sstatic.net/4LrwI.png My goal is to determine when the fourth chip wraps to the next line within the autocomplete so that I can proceed with additional c ...

Using JavaScript to Detect Asynchronous Postbacks in ASP.NET AJAX

Seeking advice on the JavaScript code required to determine if an asynchronous postback is in progress. Can anyone help with this? Appreciate any assistance. ...

Using JSON parsing to extract an integer as the key in JavaScript

I've been searching for almost 2 hours now, but I can't seem to find anyone using an integer as the key in their json object. The structure of my json object is as follows: {"342227492064425": {"added":"2020-10-04T23: ...

Generating radio buttons dynamically and automatically selecting the correct button using AngularJS

In the questionnaire form, each question is looped over along with its answers to create radio buttons for each answer. The answer object contains a property called answered, which can be true or false depending on whether the answer has been previously ...

Query the number of Firebase instances using the firebase.appCount property in Firebase v

When setting up Firebase in my React applications, I typically initialize it as follows: if (firebase.apps.length < 1) { firebase.initializeApp(firebaseConfig); // Additional initialization for other Firebase products } This method was working flaw ...

Storing numerous sets of application credentials in Node.js using a specific design pattern

As I develop a node.JS server that communicates with Microsoft APIs, the server manages multiple applications created in Azure, each requiring a configured Client ID and Client secret. I have implemented a strategy to switch between these credentials based ...

The process of utilizing variables to form objects in ES6

My ES5 code contains a variable as shown below. var options = { clientId : clientId, keepAlive : keepAlive, clean : clean, reconnectPeriod : reconnectPeriod, will : lastWillMessage }; If I want to convert this to ES6, I can do so by writing ...

How to determine if a Webelement is enclosed within another Webelement using Selenium?

Currently, I am diving into the world of Selenium by constructing a test framework specifically for Trello. The reason behind this venture? Simply because it's free and offers a decent level of complexity to work with. My current challenge revolves a ...

Learn the best method for accessing and utilizing an existing file effortlessly

As a newcomer to PHP, I have successfully learned how to upload a file from a list using the following code: var file = e.target.files[0]; alert(file); This code returns an [object File], indicating that the file has been uploaded. Now, my question is: ...

Ensuring Jquery validation is triggered before submitting a form to PHP

I have been struggling with a particular issue and decided to seek help. I have a form filled with user data that I have successfully validated using js/jQuery before sending it to php for processing. Here is how I am achieving this: form.submit(functio ...

Ensuring thread safety by locking a shared variable in parallel threads using C#

I am currently working on a code snippet that involves a BlockingCollection in C#. var queue = new BlockingCollection<int>(); queue.Add(0); var producers = Enumerable.Range(1, 3) .Select(_ => Ta ...

Loading Polymer elements via XHR can cause malfunctions and prevent them from working properly

As I try to utilize XHR to load a document and then transfer certain nodes into the main document, I encounter an issue with Polymer elements from the loaded document not functioning properly once moved. Instead, they appear and act like standard <div&g ...

Is it better to append content in JQuery rather than replacing it with .innerHTML?

Here is a function designed to retrieve older wallposts from a user, 16 at a time, and add each chunk of 16 to the end of the current list in the div called "sw1". The function works well, except when there is a wallpost containing a video or embedded obj ...

In what scenarios is AJAX not typically employed in conjunction with REST?

When looking to retrieve information from a database or send data to it, AJAX often comes in handy. Is REST the primary use case for AJAX, or are there other situations where it is commonly utilized? If so, what are those alternative scenarios? ...

The functionality of `wp_ajax data_fetch` fails to operate properly in the presence of a Custom Post Type (CPT

When I include the custom post types ('applicazione' and 'miscele') in the array for 'post' and 'page', they are not being searched. However, when I only include the CPTs, it works properly. Can you please help me id ...

Creating a Clickable SVG Element in React

I've been attempting to set up an onClick event in React, specifically within an SVG that includes multiple circle objects. However, when using "onClick," I'm encountering a strange issue: Upon data load, the onClick event is triggered six times ...

What is the best approach to resolving the MongoServerError: E11000 duplicate key error?

Index.Js File: const cookieSession = require("cookie-session"); const express = require("express"); const app = express(); const helmet = require("helmet"); const morgan = require("morgan"); const dotenv = require(&q ...