문제

I'm loading a partial view with an AJAX call:

public ActionResult LoadServerForm()
        {
            //data stuff

            ViewData["ApplicationID"] = appID.ToString();
            ViewData["Servers"] = ServersList(appServerRep.Session, null, appServers);
            return PartialView("Application_AddServer");
        }

This works great, but I'm trying to get away from magic ViewData strings. I tried making the partial view inherit from the same ViewModel as the "hosting" page, but the Model object is null when I try to this in the partial view:

<%= Html.HiddenFor(model=>model.Application_Key, Model.Application_Key) %>

Is there a way to pass the main page ViewModel down into the AJAX-loaded PartialView or should I be looking for a different approach altogether?

도움이 되었습니까?

해결책

사이트 설정에 추가하여 원하는만큼 많은 사이트 모음 관리자를 가질 수 있습니다.사이트 컬렉션 생성 중 2 개를 지정하는 것에 대한 아이디어는 첫 번째 SCA가 아웃 (의료, 휴가, RV에서 RV에서 의료, 휴가, RV에서, 무엇이든지, 뭐든지) 을 대비하여 백업해야한다고 생각하는 것입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top