Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why this code is not executing?
Message
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01555962
Message ID:
01555969
Vues:
30
>>Hi everybody,
>>
>>I have a working Client controller with the Client method which I changed today to be this:
>>
>
>>Do you see what am I missing here? Why my Edit view is not being executed by the code above?
>
>You're trying to return both a JSON result in one case, and a View in the other. Those are two completely different return types and you usually have two actions for them. So you've probably got some code in the page being displayed that is actually expecting to receive a JSON result back but instead you've passed it a bunch of HTML. It can't parse it so it's either failing or just not doing anything.
>
>To do what you want you will most likely need to handle this on the client side via some Javascript. What I've done in the past is hooked into an event the grid fires after retrieving a result (hopefully whatever grid you're using has such an event) and looking at how many items were returned. If it was only one record, I do a redirect on the client side to the edit page.

Can you please show a sample of the client side redirect? Also, how will it get the model I am passing?
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform