Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DropDownListFor binding
Message
 
 
À
15/01/2013 13:27:08
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 5.0
Divers
Thread ID:
01562476
Message ID:
01562893
Vues:
30
>>The Details method is never called :( I don't know how to really trace jquery as the underlying code is too hard for me. I see something is going on in the debugger, but I never see any alert.
>>
>>I've changed the code to
>>
>>
>>  $.getJSON(url, id, function (data) {
>>                    //  setFormControls(data.Id, data.Role, data.Location, data.JobType, data.Description);
>>                    alert(data);
>>                });
>>
>>Do you or anyone see what is wrong here?
>
>If it's not returning then presumably the url is wrong. Does the controller get hit?

I made a slight change but I still can not get it work for me. I can see the get request returns correct HTML (I am looking at Net tab in FireBug, but still the form comes blank).

Here is what I see (see attached). The last request does return correct HTML, I tested.

My latest code is
 var url = '/Client/Edit/' + id ;

                $.getJSON(url, function (html) {
                    //  setFormControls(data.Id, data.Role, data.Location, data.JobType, data.Description);
                    // alert(data);
                    $('#editor').html(html);
                });
               //location.replace(url);
               RunModalDialog("Edit Client: " + ClientName);
and the controller's code:
  public ActionResult Edit(int id)
        {
            ClientViewModel model = new ClientViewModel(); 
            var client = Db.GetClientById(id);
            model.Client = client;
            
            return PartialView("_ClientForm",model);
        }
Do you see what is missing?
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform