Results 1 to 2 of 2

Thread: scriptmanager updatepanel with jquery

  1. #1
    Join Date
    May 2010

    scriptmanager updatepanel with jquery

    Im pretty new to AJAX.... but i already figured out thats its relatively simple to enable AJAX on you website....

    just add a scriptmanager and update panel en contenttemplate.... now this works perfect.....

    now i want to add jquery functionality... this works not too good

    I simply want to add a datapicker to some fields in my webpage, this works , but as soon as there is a postback of a dropdownlist or something else, its broken....

    i can give you the code but i simply need a toturial and some advice if this is possible or not to keep having the AJAX scriptmanager AND use the jquery things.... or that you must choose ?

    on every page load i have put the function RegisterScripts()
    when its not postbacked , and it is postbacked
    ( why ? the ISstartupregistered should check if the script is already on the page or not in every case so .... )

        Protected Sub RegisterScripts()
            'Dim bln As Boolean = ClientScript.IsStartupScriptRegistered("datepicker")
            If Not (ClientScript.IsStartupScriptRegistered("scr_datepicker")) Then
                Dim strScript As String = ""
                strScript = "<script type='text/javascript'>"
                strScript += "$(document).ready(function() {"
                strScript += "$('#" + txtGeboortdatum.ClientID + "').datepicker();"
                strScript += "$('#" + txtBeginWerkloosheid.ClientID + "').datepicker();"
                strScript += "});"
                strScript += "</script>"
                ClientScript.RegisterStartupScript(Me.GetType, "scr_datepicker", strScript, False)
            End If
        End Sub
    but this check (ClientScript.IsStartupScriptRegistered) is always false, why ????

    i guess it gets broken by inserting it twice....

  2. #2
    Join Date
    May 2010
    after like 3 days, i just figured out i have to use the scriptmanager to add the script ( DUH ?! ) but nowhere on the net i have noticed this....

    so instead of using clientscript.register.....

    i need to use Scriptmanager.Register

    (cursing very very loud ...... )

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center