Google Groups Home
Help | Sign in
AJAX Method isn't getting called
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post will appear after it is approved by moderators
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sri  
View profile
 More options Oct 31 2008, 9:31 pm
From: Sri <srkvella...@gmail.com>
Date: Fri, 31 Oct 2008 13:31:28 -0700 (PDT)
Local: Fri, Oct 31 2008 9:31 pm
Subject: AJAX Method isn't getting called
 Hi All,

    I am using AJAX to populate a textbox(txtFac) based on the values
in a dropdown(ddlyear) and a textbox(txtproj) on click of a
button(btnView).

Problem is:- The AJAX method isn't called

Code in the javascript

eh.addEvent($("btnView"), 'click', function() {
fnValidate();

}, false);

function fnValidate()
{
       var varInvtyr =
frmGiEiaEdit.document.getElementById("ddlyear");
       var varGIProject =
frmGiEiaEdit.document.getElementById("txtProj");
       if(varInvtyr.options[varInvtyr.selectedIndex].text==" ")
       {
        alert("Select a year");
        return false;
       }
       else if(varGIProject.value.length == 0)
       {
        alert("Enter a project Value");
        return false;
       }
       else
       {
         getGiEiaValues();
       }
     }
     function getGiEiaValues()
     {
       var
varInvtYrValue=frmGiEiaEdit.document.getElementById("ddlyear");
       var varGIProjectValue =
frmGiEiaEdit.document.getElementById("txtproj");

       //Calling Method in Ajax , this isn't getting called

GIEIAMethods.GetGIEIAData(varInvtYrValue.options[varInvtYrValue.selectedInd ex].text,getFieldTableCallback);
     }
    function getFieldTableCallback(response) {
    if (response.error) {
        alert("GiEiaValues error: " + response.error.Message);
    }
    else {
        alert("else - getFieldTableCallback");
        var org = $("txtFac");
        if (org) {
            var table = response.value;
            if (table && table.Rows && table.Rows.length == 1) {

               //Name of the Column which i want to populate in
textbox EIAFactor
                var varEIAFactor = table.Rows[0].EIAFactor;
                if (varEIAFactor)
{

org.text=varEIAFactor;
                }
            }
        }
    }

}

Code in Ajax

<AjaxPro.AjaxNamespace("GIEIAMethods")> _
Public Class GIEIAMethods
    <AjaxPro.AjaxMethod()> _
    Public Function GetGIEIAData(ByVal InvtYr As Short) As DataTable

        //Hard coded the value for time being
        Return DataAccessTier.GIEIADataMethods.GetGIEIAData(InvtYr,
"0000345")
    End Function
End Class

I registered this namespace in .aspx.vb file
AjaxPro.Utility.RegisterTypeForAjax(GetType(GIEIAMethods))


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google