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

  • SEARCH
  • Home
  • 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 6158925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:02:36+00:00 2026-05-23T21:02:36+00:00

I have a userControl foo.ascx registered on and loaded on index.aspx. On foo’s page_load

  • 0

I have a userControl “foo.ascx” registered on and loaded on index.aspx. On foo’s page_load I am calling a javascript method which is created on foo’s markup page. I am using Page.ClientScript.RegisterClientScriptBlock The problem I am running up against is, during the loading of the user control the ClientScriptBlock code seems to be calling the javascript before the javascript is rendered. Below is an example of the page source i have and the problem IS StartCounter(“25:10”); IS being called before the function is created. Any help would be great. Thank you very much.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script type="text/javascript" src="Assets/Javascript/jQuery.js" ></script>
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    </title></head>
    <body>
       <form name="form1" method="post" action="default.aspx" id="form1">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTUxOTYxMTY4OGRkounMyYFBle29baVV35X4KzMIHn4=" />
    </div>   
 <type="text/javascript">
//<![CDATA[
StartCounter("25:10");//]]>
   </script>
       <div>
    <script type="text/javascript" src="../Assets/Javascript/Timer.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
      });
    function StartCounter(startTime)
    {
      $('#counter').countdown({
        stepTime: 60,
        format: 'mm:ss',
        startTime: startTime,
        digitImages: 6,
        digitWidth: 53,
        digitHeight: 77,
        timerEnd: function() { alert('end!!'); },
        image: "/Assets/Images/digits.png"
      });
      }
  • 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-05-23T21:02:37+00:00Added an answer on May 23, 2026 at 9:02 pm

    Try to register the js in this way in RegisterClientScriptBlock from server side it will solve the problem.

    $(document).ready(function(){ StartCounter("25:10"); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Have usercontrol and i registered the following javascript method in code behind :
I have a UserControl which overrides the OnRender-Method as follow: MyUsercontrol.cs: MyUserControl: UserControl {
I have a UserControl which I have added to my web.config <add tagPrefix=BCF src=~/controls/MyMessageBox.ascx
I have a aspx usercontrol with static readonly string foo = GetFromDB(); now I
I have a UserControl (lets say Foo.ascx) that has a Type public property with
If I have a UserControl like this: <%@ Control Language=C# AutoEventWireup=true CodeBehind=Foo.ascx.cs Inherits=Foo %>
I have a UserControl which contains a TextBox . When my main window loads
I have a UserControl A which contains a dropdown a placeholder At runtime the
I have an aspx page that includes a javascript file in the head tag.
I have a usercontrol which I need to set a specific DataContext on. The

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.