Skip to content
Advertisement

How to Invoke Button click Event of .ascx after checking timeout value using Javascript on its .aspx File

  • I have 2 Files. One is aspx and its ascx.
  • aspx contains Javascript which calculates count down time for exam.
  • while timer value reaches to 00:00:00 I want to invoke an event “Submit Exam” which is in ascx file.

Final Paper.aspx.cs

Final Paper.aspx

Exam_paper.ascx

Advertisement

Answer

Make your btnSubmit a public property of your usercontrol, so that it can be accessible from your aspx file, and at the same time accessible from the client script. Here is a little example.

UserControl Code:

Usercontrol HTML:

ASPX:

Good luck!

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement