Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


calling ASP.net  function from javascript

Posted on 2003-03-07
Medium Priority
Last Modified: 2012-05-04
I'm getting the time limit from the database and then start counting down the clock.

This is my code under script tag inside aspx file

var CDTimer1 = new CountDownTimer(<%# getTimeLimit() %>);

As you can see i have put the function getTimeLimit() that returns an integer , e.g 35.

Here is the function in aspx.vb file
Function getTimelimit() As Integer
        Dim drtimeLimit As SqlDataReader
        Dim gValue As clsGetValues

' this here would get the value from the database and keep in the datareader object
        drtimeLimit = gValue.SP_DataReader("sp_TimeLimit", "@ActivityID", "25")
        If drtimeLimit.Read() Then
            Dim temp As String = drtimeLimit("TimeLimit")
            Dim value As Integer
            value = CInt(temp)
            getTimelimit = value
            drtimeLimit = Nothing
            getTimelimit = 0
        End If
    End Function

It compiled successfully but doesn't do the needed work. Somehow CDTimer1 variable is set to 0. I don't understand why. I also want to know what is the different between <%# and <%= tag and when to use them

Question by:der_23
1 Comment

Accepted Solution

Koma666 earned 900 total points
ID: 8087101
<%= is the same like response.write

try to set your timelimit to 10 in your


if the CDTimer1 then is set to 10 then the problem is that
drtimeLimit.Read() = false

i don´t know much about asp.net only asp but have a closer look at the read function, perhaps read needs a parameter.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month11 days, 21 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question