Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why this code is not executing?
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
MVC
Title:
Why this code is not executing?
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01555962
Message ID:
01555962
Views:
74
Hi everybody,

I have a working Client controller with the Client method which I changed today to be this:
 int Total = clients.Count();

            if (Total == 1)
            {
                return View("Edit", clients);
            }
            else
            {
                clients = clients.Skip((page - 1) * rp).Take(rp);

                var flexgrid = new
                {
                    page = page,
                    total = Total,
                    rows = clients
                    .Select(x => new
                    {
                        id = x.Id,

                        cell = new { Id = x.Id, Number = x.Number, Name = x.Name, Contact1 = x.Contact1.Contact ?? String.Empty }
                    }
                    )
                };

                return Json(flexgrid, JsonRequestBehavior.AllowGet);
            }
        }
So, the idea is to go directly to the Edit view if the search returns only 1 row. I put a breakpoint on the return view('Edit', clients) line. After that line is hit, nothing happens. The Edit view is not opened.

Do you see what am I missing here? Why my Edit view is not being executed by the code above?
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform