Q:

.Net Mvc RazorView & Entity Framework: Controller not found

I am using Razorview and Entity Framework and I am trying to achieve the following: I have a dropdown(id=ColumnName) that has a list of column names and a textbox(id=SearchValue) for value to be searched from a table. On click of a button, I am trying to retrieve from the database, the record where the column name is 'ColumnName' selected and value='SearchValue'. I am getting a 404 Resource Not found error on click of the button. I am not sure where I am going wrong. My code is as follows:
HTML: 
<select id='mySelector' name="ColumnName">
    <option value="">Please Select</option>
    <option value='Country'>Country</option>
    <option value='Title'>Title</option>
    <option value='State'>State</option>
</select>
<input type="text" id="cs" name="SearchValue">
<input type="button" value="Search" onclick="location.href='@Url.Action("FilterByColumn", "CountryController")?SearchValue=' + document.getElementById('cs').value + '&ColumnName=' +document.getElementById('mySelector').value" />
<table id='myTable'>
// values
</table>

CountryController:
public ActionResult FilterByColumn(String ColumnName, String SearchValue)
{

    if (!String.IsNullOrEmpty(SearchValue))
    {
        List<Country> result = new List<Country>();
        result = db.Countries.ToList();
        result = db.Countries.Where(ColumnName + ".Contains" + "(\"" + SearchValue.ToLower() + "\")").ToList();
        return View(result);
    }
    return RedirectToAction("Index");
}

Note: I have other methods like create,edit in this controller. 
Also the URL rendered which throws the 404 error is :
/CountryController/FilterByColumn?SearchValue=sample&ColumnName=Title

A:

Your code as flollows
   <input type="button" value="Search" onclick="location.href='@Url.Action("FilterByColumn", "CountryController")?SearchValue=' + document.getElementById('cs').value + '&ColumnName=' +document.getElementById('mySelector').value" />

Never give CountryController, just Give Country and try. Edit your code as follows and try
  <input type="button" value="Search" onclick="location.href='@Url.Action("FilterByColumn", "Country")?SearchValue=' + document.getElementById('cs').value + '&ColumnName=' +document.getElementById('mySelector').value" />

and give the parameters in same order in both razor and controller

