This is a migrated thread and some comments may be shown as answers.

[Solved] Error! The requested URL returned 404 - Not Found

0 Answers 78 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gayathri
Top achievements
Rank 1
Gayathri asked on 14 Feb 2013, 08:20 AM
Hi,

This is my .cshtml code
<td><b>District</b></td>
<td> @(Html.Telerik().DropDownList()
                 .Name("ddldistrict")
                 .BindTo(new SelectList((IEnumerable<CMAStepup.Models.ApplicationMaster>)ViewData["DistrictList"], "DistrictCode", "DistrictName"))
                 .Placeholder("Select District..")
                 .CascadeTo("ddlULB1")
                 
            )</td>
<td><b>ULB</b></td>

<td> @(Html.Telerik().DropDownList()
                  .Name("ddlULB1")
               //   .BindTo(new SelectList((IEnumerable<CMAStepup.Models.ApplicationMaster>)ViewData["DistrictList"], "DistrictCode", "DistrictName"))
                   .DataBinding(binding => binding.Ajax().Select("_GetDropDownListULB","DistrictCode"))

                  .Placeholder("Select ULB..")
                  .CascadeTo("ddlzonec")
                  
            )</td>


and this is the code in the controller
     
        public JsonResult _GetDropDownListULB(int? ddldistrict)
        {
            return _GetULB(3);
        }


        //Fetch ULB based on the district selected
        //14.2.2013  
        private JsonResult _GetULB(int? districtcode)
        {
            SJSRYDataContext SJSRYcntxt = new SJSRYDataContext();
            IQueryable<ULB_Master>  ULB = SJSRYcntxt.ULB_Masters.AsQueryable<ULB_Master>();

            if (districtcode.HasValue)
            {
               ULB = ULB.Where(u => u.District_Code == districtcode.Value);

            }
            return Json(new SelectList(ULB, "ULBCode", "ULBName"), JsonRequestBehavior.AllowGet);
        }
but i am getting error 404 - not found while clicking the district telerik drop down.  please help
Tags
ComboBox
Asked by
Gayathri
Top achievements
Rank 1
Share this question
or