2018-04-24

Click Once, Sort by Name, Click Twice Sort by Desc in MVC

Click Once, Sort by Name, Click Twice Sort by Desc in MVC



    ViewBag.NameSortParm = sortOrder == "name" ? "name_desc" : "name";
    // Rest of your sortOrder param goes here...

    var persons = from s in db.PRT_FEE_PRICES
                  select s;
    switch (sortOrder)
    {
        case "name":
            persons = persons.OrderBy(s => s.NAME);
            break;
        case "name_desc":
            persons = persons.OrderByDescending(s => s.NAME);
            break;
        // ...
    }


No comments:

Post a Comment

Setup VNC on Ubuntu 20.04

  sudo apt update sudo apt install xfce4 xfce4-goodies sudo apt install tigervnc-standalone-server sudo apt install tightvncserver vncserver...