Refreshing the page when a popup is closed in ASPX and C#

I am facing an issue with my code.

Within my asp:Wizard element, I have multiple steps. In one step, when I click on a button, a popup opens using window.open to select a date and time. However, after selecting the datetime in the popup, it is not visible in the parent window until I manually refresh the page by clicking on window.open again. I've tried reloading the parent page when closing the popup using

window.parent.opener.location.reload
, but this approach resets the active step of my wizard. So, I'm looking for a solution that allows me to partially refresh the page while keeping the current step intact. Below is the relevant code snippet:

My opener:

var childWindow = window.open("../../Utils/CalendarPopup.aspx?DatePred=Stateme‌​ntDateFrom", "", "height=280; width=285;");
childWindow.onunload = function () 
{ // Need to reload here }

My popup:

Session[Request.Params["DatePred"]] = CalendarSelectDate.SelectedDate;
Session["CalendarPopupCanceled"] = 0;
this.ClosePage();

Data loading:

if (Session["StatementDateFrom"] != null)
        {                
            {
                (WizardProcess.FindControl("DtTxtBxStatementDateFrom") as Syncfusion.Web.UI.WebControls.Shared.DateTimeTextBox).IsNullDate = false;
                (WizardProcess.FindControl("DtTxtBxStatementDateFrom") as Syncfusion.Web.UI.WebControls.Shared.DateTimeTextBox).Value = System.Convert.ToDateTime(Session["StatementDateFrom"]);
            }            
            Session["StatementDateFrom"] = null;
        }

Thank you for your assistance.

Answer №1

I'm not sure about the method you used to write your code, but is it necessary to refresh the child window? If you have a control such as a textbox that shows the selected datetime from the childWindow, you can simply update the control's value with the selected datetime. This approach might be simpler than attempting to refresh just the wizard!

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

Creating a JSON Array from a PHP Array with json_encode()

I have used the built-in json_encode() function to encode an Array that I created. I am in need of formatting it into an Array of Arrays as shown below: { "status": "success", "data": [ { "Info": "A", "hasil": "AA" }, { " ...

Enhancing Win8 apps with AppendTo/jquery-win8

Recently, I've been intrigued by the ToDoMVC samples and decided to try porting them into a Windows 8 JS app. I thought it would be as simple as copying and pasting the code while making sure to reference the necessary WinJS libraries. However, I soo ...

Remove the JSON object from the screen in an asynchronous manner

I am currently working on developing a single-page application that retrieves information from a JSON file, displays it on the screen, and performs various actions. At this point, all the information is being properly displayed on the screen: http://jsfid ...

Tips for locating the position and length of a substring within a text file

I have a text file with specific instructions on how to extract substrings from a larger string. // example data String Data = "NAMENAMENAMENAMENAMENAMENAMEAGE119861126" The text file provides the position and length for each element: Element Len ...

Creating a dynamic table accordion with PHP and MySQL

I am currently working on creating an accordion table to display data retrieved from a database. I want the description data to be shown in a row below when clicking on the respective row. Despite my efforts in modifying various code snippets that I have c ...

Employing the power of JavaScript to enable the seamless toggle of an overlay

I have a div named "navbar_menu". On clicking this div, I want the visibility of the div named "nav_overlay" to fade in. Upon another click, I want it to fade back and become invisible again. Currently, I have set the div 'nav_overlay" to have ' ...

Manipulate JSON data using a string path in JavaScript

Suppose I have the following JSON data, which can easily be converted into a JavaScript object: { "foo": { "bar": "Common substitute word", "baz": "Another common substitute word", "questionWords": { "wat": "Inadequ ...

dynamic text overlay on a bootstrap carousel

Having limited knowledge in html and css, I am using a bootstrap carousel slider with text. I am trying to change the color of the box randomly. https://i.sstatic.net/TozUP.jpg Here is the code that I am currently using: <ol class="carousel-indicato ...

Implement a timer reset function with JavaScript on a click event

Here is the JavaScript code that I am working with: <script> $(document).ready(function () { window.setTimeout(function () { $('#logout_warning').reveal(); }, 6000) }); $(document).ready(function () { window.setTimeout( ...

How can I locate an element using JavaScript in Selenium with C#?

Dealing with an outdated portal that requires the use of IE. There are certain elements, such as those within a <td> menu, that cannot be located. I attempted to locate them using XPath, but it was unsuccessful. Upon further inspection, I discovered ...

How can I implement a loop using .then in JavaScript?

Looking to understand the .then concept in JavaScript, I am curious if it is feasible to generate a series of .then's using a for loop. request.send(myRequest) .then(r => console.log(r, 0)) .then(r => console.log(r, 1)) .then(r => ...

Utilizing Apostrophes in jQuery Auto-complete Function

My current code is functioning well except for one issue - it fails when trying to search for names with apostrophes in them. How can I modify the code to allow searching for people with names containing apostrophes? function autoComplete() { $(document ...

Angular.js: Applying a style to elements beyond the current scope based on the selected route

I'm looking to dynamically add classes outside of the current scope. Specifically, I need to add classes to the header, main, and footer elements as shown below: <header class="{{pageClass}}"></header> <main class="{{pageClass}}" ng-vi ...

Tips on recycling JavaScript files for a node.js API

I'm currently using a collection of JS files for a node.js server-side API. Here are the files: CommonHandler.js Lib1.js Lib2.js Lib3.js Now, I want to reuse these JS files within an ASP.NET application. What's the best way to bundle these f ...

I am working on customizing my WordPress website using three.js to add a background with a wireframe effect. However, I am facing difficulties in placing a sphere at the end of each line

I have a beautiful turquoise diamond and I want to incorporate a directional camera view in the background of a WordPress section. However, I am unsure how to achieve this. The issue I'm facing is that I created a wireframe over the diamond, but when ...

What is the best way to determine if a variable is an object array or not?

I need to determine whether a variable is an Object array or not. Consider the following example data: var myColumnDefs = [ {key:"label", sortable:true, resizeable:true}, {key:"notes", sortable:true,resizeab ...

Prevent Dehydration issue while using context values in Next Js

Every time I log in with a user, update a context value, and re-render some components, I keep encountering a Hydration error in Next Js. The issue seems to be specifically with my NavBar component which is rendered using react-bootstrap. The code snippet ...

Develop settings for an application on the Windows Phone 7 by accessing the settings section

I am new to windows phone development, so please forgive my lack of knowledge. I am working on an application and I would like to create a settings page for it in the phone settings, specifically under settings -> myApp -> myAppSettingsPage. Is this ...

Is there a way to verify the presence of a key/value pair in a Dictionary?

Is there a way to verify the existence of a key/value pair within a Dictionary<TKey,TValue>? While I know how to check for the presence of a key or value using ContainsKey and ContainsValue, I am uncertain about verifying the existence of a specifi ...

Is it possible to automatically submit a form at regular intervals without reloading the page and simultaneously insert the submitted data into

I am attempting to automatically submit a form every x number of seconds without refreshing the page and then insert the input data into a MYSQL database. The problem I'm facing is that while I can successfully insert the form's input value into ...