방법

-1

난 면도기보기 여기방법

<div class="form-group"> 

       <div class="col-md-10"> 
        @Html.Action("ShopOwnerEditMobilePartial", "ManageShop", new { appUserId = Model.ApplicationUserId }) 

       </div> 
       <br /> 
       <div class="form-group"> 
        <div class="col-md-offset-2 col-md-10"> 
         <input type="button" value="Save Changes" onclick="updateMobile()" class="btn btn-primary btn-block pull-right" /> 
        </div> 
       </div> 
      </div> 

인 부분도를 이용하여 로그인 한 사용자의 휴대 전화 번호를 채우고있는 부분이 asp.net의 MVC에서 jQuery를 사용하여 ID로 부분도 입력 필드 값을 얻을 컨트롤러 코드 여기

public ActionResult ShopOwnerEditMobilePartial(string appUserId) 
    { 
     Repository rep = new Repository(); 
     ViewBag.MobileNumber= rep.GetMobileNumberByAppUserId(appUserId); 
     return PartialView("_ShopOwnerEditMobilePartial"); 
    } 

는 면도기보기 여기

<input type="text" class="form-control" maxlength="20" id="MobileBox" 
     name="crimeRef" placeholder="Mobile Number" 
     value="@(ViewBag.MobileNumber ?? String.Empty)"/> 

의 HTML 코드 것은 내 코드입니다 MobileBox ID를 이용하여 값의 취득에 실패 JQuery와는

I는 휴대 전화 번호의 수정 값을 가져올 때 문제가 온다
var CityNewValue=""; 
function updateCity() 
{ 
    CityNewValue=$('#CityDDL').val(); 
    $.ajax({ 
     url: '@Url.Action("updateCity", "ManageShop")', 
     method: 'post', 
     data: { shopId:@Model.ShopId,NewCityID:CityNewValue},  //the data to be passed to the server 
     dataType: 'json',     // data that we are expecting back from the server 
     success: function (data) {   // data variable will contain the data fetched from the server 
      $('#successAlert').slideDown(); 
     }, 
     error: function (err) { 

     } 
    }); 
} 

는 부분도

정의 MobileBox ID 및 updateCity() 기능 모두에 대하여 잡히지 않은 예외가 온다

답변

0

모든 코드가 정확합니다. 필요한 작업을 수행하기 전에 코드에서 return 문을 사용 했으므로 원하는 코드 줄에 도달 할 수 없습니다.