TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pankaj Pawar
NA
116
10.5k
redirect to another page if page reloaded 2nd time
Dec 28 2018 1:27 PM
i have a Quiz webpage, that showing questions and time with timer control. now i want that,
if user click on browser reload button and try to reload webpage then he/she will be redirected to another page.
code should be work only, if user try to reload. Not when first time page loaded.
i tried this code
var reload = confirm("are you sure you want to leave? your progress will be lost");
if (reload) {
location.href = "http://stackoverflow.com"; // Redirect.
}
but this code. showing confirm box, very first time also, when page loaded.
now i dont want to show this confirm box and redirect when first time web page loaded.
i want that. code should be work only, if user try to reload. Not when first time page loaded.
or if there is a way to achieve this in server side coding. asp.net C# 4.5 2017
Hope you Understand,
thanks for any help.
Reply
Answers (
1
)
The name ViewBag does not exist in the current context
Tooltip on Calendar at Dayrender event