我必须分页的列表实际上是目录中的条目。我没有从数据库中获取数据。我的控制器部分:
public ActionResult Index()
{
// Iterate over all folders in the SCORM folder to find training material
UrlHelper urlHelper = new UrlHelper(HttpContext.Request.RequestContext);
string scormRelativePath = urlHelper.Content("~/ScormPackages");
string scormRootDir = HttpContext.Server.MapPath(scormRelativePath);
string scormSchemaVersion = string.Empty;
string scormTitle = string.Empty;
string scormDirectory = string.Empty;
string scormEntryPointRef = string.Empty;
string scormIdentifierRef = string.Empty;
Int16 scormLaunchHeight = 640;
Int16 scormLaunchWidth = 990;
bool scormLaunchResize = false;
string scormRelativeHtmlPath = string.Empty;
List<ScormModuleInfo> modules = new List<ScormModuleInfo>();
foreach (var directory in Directory.EnumerateDirectories(scormRootDir))
{
ScormModuleInfo module = new ScormModuleInfo();
//more code
}
}
在我看来:
<% int idx = 0;
foreach (var module in Model)
{ %>
//lists names of the folders in the ScormPackages directory
}
那么在这种情况下我将如何处理分页呢?
谢谢