Saturday, 3 May 2014

Search box in MVC

Put in Index File...
<p>
   @using (Html.BeginForm("Index", "Department", FormMethod.Get)) {
   <b>Search By:</b>@Html.RadioButton("searchBy", "search",true)<text>Name</text>
       @Html.TextBox("search")<input type="submit" value="search" />
   }
    </p>

---DepartmentController
 public ActionResult Index(string searchBy, string search)
        {
            if (searchBy == "Name")
            {
                return View(db.Departments.Where(x => x.DprtName.StartsWith(search)).ToList());
            }
            else
            {
                return View(db.Departments.Where(x => x.DprtName.StartsWith(search)).ToList());
            }
         
        }




How to improve applications performance which is hosted in cloud ?

Improving the performance of an application hosted in Microsoft Azure involves a combination of optimizing your application code, leveraging...