Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Set data to Textbox in onsuccess function.

$
0
0

Hi;

I am not familiar with web programing. I just start to web coding.

I have problem and working on it for long time.I haven solution yet. I have ajax fonction

 

function Formgoster() {

var params = {     name: $("#TextBox1").val(),

                surname: $("#HiddenField1").val()

            };

            $.ajax({   type:"POST",

                url:"WebForm7.aspx/GetCurrentTime",

                dataType:json',

                data: JSON.stringify(params),

                contentType:'application/json; charset=utf-8',

                error: function (XMLHttpRequest, textStatus, errorThrown) {

                    alert("Request:"+ XMLHttpRequest.toString() +"\n\nStatus:"+ textStatus +"\n\nError:"+ errorThrown);

                },

                success: function (response)

                { document.getElementById('TextBox2').value = "zzzz"; }

            });

        }

problem is assign vaue to Textbox2 Apper 2 second then dissepear agein

when i change function like this

                success:  Goster () 

<scripttype="text/javascript">

function Goster() { 

            document.getElementById('TextBox2').value = "zzzz";

        }

</script>

Everything works right :( I dont know what is reason for that . I need to use respons so i have to do that work in my first sampel becouse i dont know how to pass return data to another script.

Another problem is this ajax doesnt work on google chorome works on ie.

Thanks for help;

 


Viewing all articles
Browse latest Browse all 5678

Trending Articles