有关PartialView的MVC Scorm排序问题

我正在研究Scorm MVC项目。基本上我需要从cs类文件更新局部视图。
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>Table of Contents Test</h2>
    <br />
    <div id="SCONavBar">
        <%  XElement item = (XElement) Model;
            String rootID = (String) ViewData["courseRoot"];
            String resource = (String) ViewData["resource"]; %>
        <button id="prev" onclick="javascript:NavigationRequest('', '<%: resource %>', 'previous');">Previous</button>
        <button id="cont" onclick="javascript:NavigationRequest('', '<%: resource %>', 'continue');">Continue</button>
        <button id="start" onclick="javascript:NavigationRequest('', '<%: resource %>', 'start');">Start Course</button>
    </div>
    <div id="scoContainer">
        <div id="treeContainter" style="display:inline-block; outline:black solid 1px; height:600px; width:300px; overflow:scroll; padding:2px;">
            <ul id="treeview">
                <% Html.RenderPartial("~/Views/Content/ActivityTreeUserControl.ascx", item); %>
            </ul>
        </div>
        <div id="contentContainer" style="vertical-align:top; display:inline-block; outline:black solid 1px;">
            <% Html.RenderPartial("~/Views/Content/ContentFrame.ascx"); %>
        </div>
    </div>
    <script type="text/javascript" src="../../Scripts/TreeView/TOCControlScript.js"></script>
    <script type="text/javascript" src="../../Scripts/TreeView/resizeFrame.js"></script>
    <script type="text/javascript" src="../../Scripts/Scorm/loungeScormMethods.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            startTree();
        });
    </script>    
</asp:Content>
以上是我的观点的代码。在第一次加载时,它会加载目录局部视图和Iframe局部视图。单击我的个人Start,Cont和Prev按钮时,AJAX请求将通过一个音序器并返回到下一段内容的链接,并在javascript中更新iframe的源。这很好用。 使用Javascript
function sendToFrame(source) {
window.frames.SCODisplay.location.href = source;
}
function NavigationRequest(id, resource, type) {
    var result = null;
    $.ajax({
        type: 'POST',
        url: '/Content/NavigationRequest/',
        data: {type : type},
        async: false,
        success: function (data) {
            result = data;
        }
    });
    if (result != null && result != "") {
        var source = "../Content/" + resource + "/" + result;
        sendToFrame(source, id)
    }
}
现在,内容有时可以通过内部按钮导航到内容。内容调用一个API包装器,它向数据模型发送一个事实,即在它终止后必须遵循继续请求。哪个有效。 现在我的问题是,在终止时,我的系统知道需要继续请求,它会确定下一条内容是什么以及它的链接。我需要找到一种方法来更新iframe的来源....
public static String Terminate() {
            //set entry to "" or resume, available to next learner session in current learner attempt
            //if exit is set to suspend via nav request suspend all then entry set to resume upon next attempt on activity
            //if exit anything other than suspend or no value set entry to ""
            //when exit = suspend - save cmi.suspend_data to session
            //decide whether to persist data
            //save info to db using entities then call commit()
            cocdType cmi;
            try {
                cmi = (cocdType)HttpContext.Current.Session["cmi"];
            } catch {
                return "false";
            }
            if (cmi.adlNavRequest != "_none_") {
                SeqObject seqObj = new SeqObject();
                seqObj.currentRequestType = SeqObject.type.Navigation;
                seqObj.data.Navigation = cmi.adlNavRequest;
                seqObj = loungeScormSeqNavHandler.SequencingProcess(seqObj);

                NEED TO FIRE OFF IFRAME CHANGE SOURCE FROM HERE
            }
            return "true";
        }
这是否有意义,任何帮助表示赞赏。     
已邀请:
我想出了一个解决方法。 我的终止函数返回iframe所需的完整链接,在原始的ajax调用中我有一个简单的if如果确定结果是真还是假,空白还是null那么它必须是一个链接然后从那里播放它。然后将结果设置为true或false。     

要回复问题请先登录注册