Hi all,
I am loading the webpage into my webbrowser and navigating, filling the from etc. while do so, if i fill the first textbox , based on that second text box has to come automatically. But it's not coming automatic. When viewing page source of that page came to know that ajax function is there to trigger. how to do that through vb.net coding.

the ajax function is like below:

$('#practices').bind('change paste input', function() {
            // when the selection of some other drop down changes 
            // get the new value
            var value = $(this).val();
            //alert(value);
            // and send it as AJAX request to the newly created action

            $('#chkAjax').val('0');
            $('#loadingPracs').show();

            $.ajax({
                url: 'getAddDataStdValues.php',
                type: 'POST',
                data: { data: value, stdfor: 'practices'  },
                success: function(result) {
                    // when the AJAX succeeds refresh the ddl container with
                    // the partial HTML returned by the Foo controller action
                    $('#ddcl-std_practices span span.ui-dropdownchecklist-text').text(result);
                    $('#ddcl-std_practices span span.ui-dropdownchecklist-text').attr('title', result);
                    selectObj = document.getElementById('std_practices');
                    var stdPracs = result.split(';');

                    //clear all first
                    for (var i = 0; i < selectObj.options.length; i++) {
                        selectObj.options[i].selected = false;
                        document.getElementById('ddcl-std_practices-i'+i).checked = false;
                    }

                    for(var j = 0;j < stdPracs.length; j++){
                        for (var i = 0; i < selectObj.options.length; i++) {
                            if (selectObj.options[i].text == stdPracs[j]) {
                                selectObj.options[i].selected = true;
                                document.getElementById('ddcl-std_practices-i'+i).checked = true;
                            }
                        }
                    }   
                    $('#chkAjax').val('1');         
                    $('#loadingPracs').hide();              

                }
            });
        });

Thanks
vaasu

I'm not sure, but I think this would work (C#):

object[] codeString = {"$('#practices).change();"};
webBrowser1.Document.InvokeScript("eval",codeString);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.