Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7921873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:44:53+00:00 2026-06-03T16:44:53+00:00

I have an asp.net c# website that I am having a problem getting the

  • 0

I have an asp.net c# website that I am having a problem getting the jscript to execute.
I have a masterpage that loads that contains the javascript and the code. A code excerpt is below. When it runs, the timer never shows up. If I click the close page button, I get an error that says:

Microsoft JScript runtime error: The value of the property ‘closePage’ is null or undefined, not a Function object.

on the line:

<input type="submit" name="ctl00$CloseSection$btnClose" value="Close Page Now" onclick="closePage(); return false;" id="ctl00_CloseSection_btnClose" class="buttons" />

I have tried many things, moving the .js src line above and below the var section. NOthing seems to change this. The strange thing is this worked fine just a few days ago. I noticed that MS made several VS updates on 9/14.

Any help would be appreciated.

I can do a view source and the js line shows up fine:

 <script src="jscripts/StoreFrontClose.js" type="text/javascript"></script>

The source excerpt is below:


<asp:ContentPlaceHolder ID="CloseSection" runat="server">
 <script src="jscripts/PageClose.js" type="text/javascript"></script>

<script type="text/javascript" language="javascript">
  var timeoutMins = 0;
  var timeoutSecs = 30;
alert("getting ready to start timer");
if (source == "kiosk") {
  startPageCloseTimer();
}              
<div style="text-align: center;">
 The Page will close in: <span id="theTime" class="timeClass"></span>
    <br />
  <asp:Button ID="btnClose" CssClass="buttons" runat="server" OnClientClick="closePage();"
                        Text="Close Page Now" />
 <asp:Button ID="btnKeepOpen" CssClass="buttons" runat="server" OnClientClick="resetTimer();"
                        Text="Keep Page Open a little Longer" />
</div>
</asp:ContentPlaceHolder>

the PageClose.js has:

    function startPageCloseTimer() {
    alertTimerId = setTimeout("AlertUser()", timeoutMilli);
    countDown();
}

function AlertUser() {
    extend = false;
    handleTimerId = setTimeout("HandleTimeout();", maxPopupTime);
    jQuery("#messagePopup").dialog("open");
}

function HandleTimeout() {
    if (!extend) {
        closePage();
    }
}

function KeepSessionAlive() {
    extend = true;
    resetTimer();
}



function resetTimer() {

    clearTimeout(alertTimerId);
    clearTimeout(handleTimerId);
    alertTimerId = setTimeout("AlertUser()", timeoutMilli);
    sec = timeoutSecs;
    min = timeoutMins;
    countDown();
}

function closePage() {
alert("getting ready to close page");
clearTimeout(handleTimerId);
clearTimeout(alertTimerId);
clearTimeout(countDownTimerId);
}

var sec = timeoutSecs; //   set the seconds
var min = timeoutMins; // set the minutes

function countDown() {
    sec--;
    if (sec == -01) {
        sec = 59;
        min = min - 1;
    } else {
        min = min;
    }
    if (sec <= 9) { sec = "0" + sec; }
    var time = "";
    if (min > 0) {
        time = (min <= 9 ? "0" + min : min) + " min and ";
    }

    time = time + sec + " sec ";

    if (document.getElementById("theTime")) {
        document.getElementById("theTime").innerHTML = time;
    }
    countDownTimerId = window.setTimeout("countDown();", 1000);
    if (min == '00' && sec == '00') {
        sec = "00";
        window.clearTimeout(countDownTimerId);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:44:58+00:00Added an answer on June 3, 2026 at 4:44 pm

    You simply forgot the closing </script> tag:

    <script src="jscripts/PageClose.js" type="text/javascript"></script>
    
    <script type="text/javascript" language="javascript">
        var timeoutMins = 0;
        var timeoutSecs = 30;
        alert("getting ready to start timer");
        if (source == "kiosk") {
            startPageCloseTimer();
        } // end of script
    </script> // close tag
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET website that is contacting a webservice. Everything works fine connecting
I have an ASP.NET MVC website that works in tandem with a Windows Service
I have an asp.net mvc website that returns a JSON result to certain pages
So I have this ASP.Net 2.0 website that uses functions contained within a JS
I have a few pages on my asp.net website that I would like to
I have a asp.net website and I am accessing that web service from my
I have a website that uses basic ASP.Net forms authentication. In the web.config file
i have a website that is being hosted on www.webhost4life.com. Its a basic asp.net
I have some pages on my public website that display charts generated by ASP.NET
I have a website (ASP.NET MVC3) that runs on IIS 7. From this website,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.