Need help ASP.NET Core with Java Script

Jerry Lipan 916 Reputation points
2022-08-13T12:50:43.713+00:00

Hi,

So far, I built this. Session Expired Alert

230889-20220813-202036-001.gif

When countdown is zero, it trigger the alert as following,

230829-20220813-202154-002.gif

_Layout.cshtml

230924-0001.png

230933-0002.png

230934-0003.png

I need help to adjust my Java Script. To make it,

  1. Timeout start at 1 minute
  2. After Click Session Alert, I need help to HIDE the Span Message

230836-0004.png

Span Message
230953-0005.png

Please help me to modify my Java Script

Developer technologies | ASP.NET | ASP.NET Core
{count} votes

Accepted answer
  1. Rena Ni - MSFT 2,066 Reputation points
    2022-08-16T07:20:19.297+00:00

    Hi @Jerry Lipan ,

    Actually, document.getElementById("xx").style.display= 'none'; can make the span hide, but you use the redirect in your js code so you cannot see such thing appear.

    Here is a demo you could follow in the txt file:

    231388-js-code.txt


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best Regards,
    Rena

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Jerry Lipan 916 Reputation points
    2022-08-14T00:43:52.677+00:00

    Hi @AgaveJoe

    Actually I want paste the code into this forum. Unfortunately, it give an error. Sorry for inconvenient

    This is is full code in Github as following,

    https://github.com/SalmiAman/CodeSessionExpired

    Now I change sessionTimeout into 20 minutes. So that, if browser idle after 19 minutes Timeout Trigger will arise

    231031-14082022-001.png

    Please help

    0 comments No comments

  2. Jerry Lipan 916 Reputation points
    2022-08-16T10:27:48.1+00:00

    Hi @Rena Ni - MSFT

    It's working. Thanks

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.