Hi all,

I associated a javascript event to a listbox (list of languages) in
order to store a text description in multiple languages.

I get the new value stored in a Session variable "onChange" event and I
set the current value "onKeydown" & "onClick" events.

I works fine when I click slowly on the listbox but when I try to
change it fast the system is going crazy replacing EN description by FR
description (too many Ajax Calls at the same time).

Do you have a workaround in order to avoid this?

You will find hereafter all the source code.

Thank you in advance for your help.

Attilio
Belgium




I'm currently using :
   Ajaxpro : 6.4.15.2
   .NET framework : 1.1
   VB.NET

VB CODE to associate Js events:
            sel_ldesc.Attributes("onChange") = "getlgdesc();void(0);"
            sel_ldesc.Attributes("onClick") = "setlgdesc();void(0);"
            sel_ldesc.Attributes("onKeydown") = "setlgdesc();void(0);"

Javascript :
function callback_getLanguageDescription(res)
{
gebid('txt_comment').value = res.value;
res=null;
}

function getlgdesc()
{
Ajaxutils.getLanguageDescription(gebid('sel_ldesc').value,callback_getLanguageDescription);
}

function callback_setLanguageDescription(res)
{
res=null;
}

function setlgdesc()
{
Ajaxutils.setLanguageDescription(gebid('txt_comment').value,gebid('sel_ldesc').value,callback_setLanguageDescription);
return true;
}


Ajax methods :
<AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.ReadWrite)>
Public Function setLanguageDescription(ByVal desc As String, ByVal lg
As Integer) As Boolean
        Try
            HttpContext.Current.Session("_Ad").f_comment(lg) = desc
            Return True
        Catch ex As Exception
            Return False
        End Try

    End Function

    <AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)>
Public Function getLanguageDescription(ByVal lg As Integer) As String
        Try
            Return HttpContext.Current.Session("_Ad").f_comment(lg)
        Catch ex As Exception
            Return ""
        End Try

    End Function


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---

Reply via email to