prabhu p

prabhu p

  • NA
  • 181
  • 113.8k

How to fix error "CS0103: The name 'url' does not exist in "

May 30 2016 4:02 AM
Iam using Mvc 4  in that view 
 
-----------------------
 
<div>
@Html.DropDownList("Mobiledropdown2",ViewBag.VBMobileList as SelectList,"Selectitem")
<select id = "state" Style ="width:100px;">
</select>
</div>
<script type ="text/javascript">
$("Mobiledropdown2").change(function(){
var selectedvalue =$(this).val();
if(selectedvalue != "Selectitem"){
$.ajax({
url: '@url.Action("GETdistrict","dis")',
tpye:'post',
data:{"seletedvalue": Seletedvalue},
datatype :'jason',
success: function (response){
var items ="";
$.each(reponse.ld.function (i,item) {
items += "<option value =\ "" + item + " \">" +item + " </option>";
}) ;
$("#Mobiledropdown2").html(items);
},
errors: function(error) {
}
});
}
else {
$("#Mobiledropdown2").empty();
}
--------------------------------------
iam getting error
 
Line 10: if(selectedvalue != "Selectitem"){ 
Line 11: $.ajax({ 
Line 12:  url: '@url.Action("GETdistrict","dis")',  // error on this line
 Line 13: tpye:'post', 
Line 14: data:{"seletedvalue": Seletedvalue},
 
--------
 
please help  to fix the error 
  

Answers (2)