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 Yes

Code in the javascript Yes

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     Yes
       GIEIAMethods.GetGIEIAData(varInvtYrValue.options[varInvtYrValue.selectedIndex].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 Yes
                var varEIAFactor = table.Rows[0].EIAFactor;
                if (varEIAFactor) {                                       
                    org.text=varEIAFactor;                                       
                }
            }
        }
    }
}

Code in Ajax  Yes

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

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

I registered this namespace in .aspx.vb file  Yes

AjaxPro.Utility.RegisterTypeForAjax(GetType(GIEIAMethods))
0
srkvellanki
10/31/2008 4:22:35 PM
asp.net.ajax-discussion 13973 articles. 1 followers. Follow

4 Replies
690 Views

Similar Articles

[PageSpeed] 16

Are all the controls in the same update panel?


I love to display the non-secure items...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
Charles
10/31/2008 5:47:14 PM

These forums are for ASP.NET AJAX, I think you are looking for information in AJAX.NET wich is a different framework, check this link:

 

http://groups.google.com/group/ajaxpro/
If this post helped you please remember to set it as Answer so it can help others.
0
mrmercury
10/31/2008 6:03:08 PM

 I am n't using Update Panel

0
srkvellanki
10/31/2008 8:33:22 PM

Yeah sorry, that's ASP.Net stuff which is what this forum is usually for.  I apologize for the confusion.


I love to display the non-secure items...
Charlie Asbornsen
Dont forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
Charles
11/3/2008 4:38:48 PM
Reply:

Similar Artilces:

Maybe this is bug in ajax,i couldn't understand, i have get the response,but the ajax script couldn't run!
the all script is :  function   onSucceeded(response)//debug here ,i could  get all the dataset result,                {                     if   (response.value   !=   null)//but  the debug point   go here , response.value is always equal null, i could not understand,if i quote this !                  &nb...

Why don't Call RegisterStartupScript() to call java don't work in ajax
normal I can use this code call java script in  .aspx page  protected void Button1_Click(object sender, EventArgs e) { ......some thing........Page.ClientScript.RegisterStartupScript(Page.GetType(), "OnLoad2", "RefreshMainpage();", true); } but  i use this code when  my buttom1 is drop on Updatepanel  then buttom1 clicked  RefreshMainpage(); don't work how To call java script in .aspx page when work with AJAX   thank    Use ScriptManager.RegisterStartupScript inste...

Does anyone know of either an ajax.net blog available or an 'inline editor' for ajax.net?
Hey all:  I'm desperately trying to find an AJAX control (I don't care if it's currently for ASP.NET AJAX.NET, since if not, I'll do the conversion and make it available to others) for creating blogs and another inline editor control, so that if there is text on the page, I can click on the text and it will automatically display an editor and allow me to edit the text/html.  Does anyone know of a control like this that's AJAX enabled?  Especially AJAX.NET.  I'm only interested in open-source, since any improvements I make I will make available on codeplex.com Thanks in...

I can't get no cache, I can't get no cache. 'Cause I try and I try and I try and, I can't get no, I can't get no cache.
I have fiddled out for days tinkering with the setting in about:config trying to get FireFox 12 to use the disk cache. I have NOT found the trick. This One Trick Pony ain't doing it like it used to up until recently. Pray tell anyone, What information can I share that will point a knowledgeable person to aid me in getting FF to disk.cache? I have also tried restarting FF with add-ons disabled, (There were NOT too many to do this to, so it was quick and easy) Here is my stab at trying to convey the information that MIGHT govern matters Using about:cache Informatio...

Re: I can't get no cache, I can't get no cache. ' Cause I try and I try and I try and, I can't get no, I can't get no cache.
<div>please com e see me about htis<br /> <br /> ------- Original Message f= rom the Global Relay Archive -------<br /> From: Hp &lt;ferd@farkel.net&gt;= <br /> To: "support-firefox@lists.mozilla.org" &lt;support-firefox@lists.mo= zilla.org&gt;<br /> Sent: Sun, 27 May 2012 18:30:18 -0700<br /> Subject: I = can't get no cache, I can't get no cache. 'Cause I try and I try and I try = and, I can't get no, I can't get no cache.<br /> <br /></div> <pre class=3D"gr-maex-body-pre&qu...

ajax .net 2 after ajax call is done how to call JS alert
 helo guys, i'm new herekindly let me know, i've used the folowing but no alertin debug i saw cursor is coming but no alert     Dim strScript As String = "<script language=JavaScript>"        strScript += "alert(""" & StrMessage & """);"        strScript += "</script>"        If (Not Page.ClientScript.IsStartupScriptRegistered("Alertscript")) Then   &nb...

Can't get 'onbeforeunload' working on AJAX-enabled page
I've just read through a ton of forum postings on here and articles elsewhere but still can't resolve the problem. Two days ago I [thought I had successfully] implemented JavaScript code to warn the user when he was exiting a web page without first saving data back to the database.  I blogged about this here.The code in question is this: function ConfirmExit() { needToConfirmExit = Boolean(document.getElementById('<%= needToSaveData.ClientID %>').value); if (needToConfirmExit) return "You have made changes that have not ...

What is the best way to do simple AJAX in .NET 2.0? "Atlas" isn't going to cut it.
Hello all, I am wanting to add some very simple AJAX functionality to my .NET 2.0 application. I want to make a "tabbed panel" control, whereby you have a panel of text with tabs at the top.  Clicking on one of the tabs will change the text inside the panel.  This will be similar to what you see on nytimes.com or slate.com.  The trick is that, like nytimes and slate, I want to do it all without having a page refresh.  Thus, I want to use AJAX. Here's what I've boiled the problem down to- ultimately, I need to be able to retrieve text from the server when someone clicks...

AJAX.net 1.0 Bridge calls with 'null' arguments
I have been using Bridge feature with Atlas November CTP and everything was working very well. When I upgraded to the AJAX.net 1.0 along with the Futures CTP, I had to modify all of the "bridge" calls as the method signatures have changed. Now, the only one problem remaining for me is that AJAX.net 1.0 bridge calls fail when a 'null' argument is specified, for example: // call the Bridge methodMyBridgeObject.GetEstimate({'argument1':'test' ,'argument2':null}, onComplete, onError); The above call worked fine with Atlas CTP, but AJAX.net 1.0 fails with exception: "Exception has been th...

PropertyDescriptor's GetValue method isn't called with a Web DataGrid
I have a collection that is implementing ITypedList (called MyCol with the collection elements called MyData) and a class inheriting PropertyDescriptor (called MyPropDescriptor). The collection's GetItemProperties-method returns a PropertyDescriptorCollection containing MyPropDescriptor instances. When setting MyCol as the datasource and calling DataBind() the IsReadOnly and PropertyType properties are being called on the instances but never the GetValue-method.It seems like the datagrid get's the column definitions (the faked properties of the MyData-class) from the PropertyDescri...

Isn't it called Mozilla? It's what the browser I'm using is called.
Name: Keith Email: BIGred1_1965atlivedotcom Product: Firefox Summary: Isn't it called Mozilla? It's what the browser I'm using is called. Comments: I'm HOPING that I can persuade somebody HERE, to install a button in Mozilla. To close the currently viewed window, WITHOUT having to close the entire browser, go check out the ADVANCED browser. It's what I WAS using before I had Mozilla installed/infecting my machine. IF you install the button I'm asking for, I'll consider KEEPING it as my browser, even though I've ALREADY got the A.B. configured....

[BUG]: __doPostback isn't added during a partial postback; this may lead to errors if the method isn't added to the page during initial rendering
The problem can be reproduced as follows: 1) Create a project. Use the Web Projects Overlay: http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx 2) Add a User Defined control (Master) 3) Add two nested User Defined Controls (NCtrl1, NCtrl2). NCtrl1 defaults to visible=true, NCtrl2 defaults to visible=false. Add some text to NCtrl2. 4) In the master control, add a public method to make visible/invisible the nested controls (NCtrl1, NCtrl2). Call it CtrlMeth1. 5) To NCtrl1 Add a GridView nested within an UpdatePanel Atlas mechanism. 6) In the GridView e...

My AJAX is not AJAXing!
Hi, I was having trouble with a new AJAX enabled code so I tried to just to do a simple test page. I did the simple Label control with button example covered in this tutorial http://www.asp.net/learn/ajax/tutorial-01-cs.aspx I'm having the same problem. Functionalitw-wise it works but the page is refreshing and flickering. That means it's not the code but maybe my set up. I'm using VisualStudio 2005 and the application is currenty .NET 2.0. In VS.NET, I do see the AJAX controls though. What could this be?Thanks,Sam did you install the Ajax extensions? Now, it's AJAXing!...

ajax or not to ajax.
Heres a strange one for you. I have a textbox, a button and a gridview on a page. I enter some search text which returns 500 odd records in under a second. When i wrap the gridview in an updatepanel, set its update mode to "conditional" and the trigger to the button the page can take 2-4 seconds to render. I think the problem is down to page redering some how as my progress indicator stops at around the same time as the normal postback would appear. I have also noticed this very behaviour and have come to the conclusion that in cases like this it is better to hand code a XMLHttp...

Web resources about - AJAX Method isn't getting called - asp.net.ajax-discussion

Resources last updated: 12/1/2015 6:19:19 PM