ajax delay
-
i have a wen application using asp .net 2 and ajax extensions. I'm using ajax to show some text boxes when selecting items from combo box without refreshing the page. the code works normally on local machine, when uploading it to the hosting server i noticed that when selecting item from combo it take about 14 sec to show the text boxes. how can i decrease the delay between Ajax request and response?or this delay is normal ?
-
i have a wen application using asp .net 2 and ajax extensions. I'm using ajax to show some text boxes when selecting items from combo box without refreshing the page. the code works normally on local machine, when uploading it to the hosting server i noticed that when selecting item from combo it take about 14 sec to show the text boxes. how can i decrease the delay between Ajax request and response?or this delay is normal ?
Use a serverside solution. For example, with JQuery, something like this:
$(document).ready(function(){
$('<%=MyDropDown.ClientID%>').change(function(){
$('<%=MyTextBox.ClientID%>').val('<=MyDropDown.ClientID%').val());
});
})Basically, once the page is loaded, you are binding a function to the change event on the drop down. The change event sets the value of the textbox using the value of the drop down. It's a little more involved without JQuery, you would use $get() to reference the controls and have to iterate the drop down to get the selected value.
Jeremy Likness http://csharperimage.jeremylikness.com/