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
Paul Rajs
NA
641
146.4k
How to Call C# Method from javascript after timer count end
Oct 21 2018 1:03 AM
Hi Developers,
I am creating a Exam page . so i want to put a timer on my page , i have tried lots using c#,but no one is working exactly. si i am added timer using javascript code . i have to call c# function from javascript when the time countdown is 0.
i have done and working but i dont know how to call C# server side Function from javascript .
my html code
<h3> Session Time <span id="countdown">10</span> seconds </h3>
my javascript code
<script type="text/javascript"> // Total seconds to wait var seconds = 3; function countdown() { seconds = seconds - 1; if (seconds < 0) { // Chnage your redirection link here window.location = "test.aspx"; //UpdateTime(time); } else { // Update remaining seconds document.getElementById("countdown").innerHTML = seconds; // Count down using javascript window.setTimeout("countdown()", 1000); } } // Run countdown function countdown(); </script>
my C# code
protected void Page_Load(object sender, EventArgs e) { } public void MyName(object sender, EventArgs e) { name(); } public void name() { lbl.Text = "Paul Raj"; }
i need to bind the C# MyName() function and Display the name "Paul Raj" after the countdown end .am trying , if anyone know this kindly help me to done this module , this is the last module of my project.
thanking you
Paul.S
'man becomes what he thinks about'
Reply
Answers (
2
)
How make login form for multiusr by using unam upas and utyp
How to remove controller name from URL in MVC