views:

584

answers:

3
+2  Q: 

jQuery - Ajax

Hi.

In A.ascx I have one DropDownList and one DIV. The DropDownList is populated dynamically.

How do I load B.ascx into the DIV, when the user changes the selected index in the DropDownList. This should be done on the client side without postback, by using jQuery and Ajax.

Thanks

+2  A: 

This article shows you. Didnt take long for me to find an example

redsquare
A: 
  function selectedindexchange() {
  $.ajax({
    type: "POST",
    url: "CONTROLNAME.ascx",
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function(msg) {
      $('#ContentDIV').html(msg.d);
    }
  });
});
SelvirK
I don't think you can use *.ascx as urls for ajax post. Only page name is valid.
nemke
A: 

This article may help you, just as it helped me for the same problem.

Andrea Celin