My users are going through a bastardized Online course that is approximately 1000 pages broken into many different levels. The user also has the ability to go look through previous material and there is a tree view with all of the chapters modules etc. that I will add soon but cannot go forward unless they are clicking on the next page button. This is because the material clearly builds on itself and should be read and interacted with this way. Also, there are short quizes as well as tests and the end of specific chapters and modules.
My question is what is the best way to add navigation at the bottom of the page that automatically goes backward one page and forward one page? Like I mentioned I already created a View that would give me a complete list as opposed to writing something that finds what level of the tree they are in, whether they have completed a tree node and need to go up a level to a new chapter (and possibly a new module) and back down to the next page.
I don't remember looping through Typed Views before but I remember reading that LLBLGen lets you define a view as an entity so I call the collection and I loop through it that way.
So the way that I have created the page that I can get the info I want is to loop through the collection and capture three values. The id from 2 pages ago, 1 page ago and the current page (which is one page past the current page that the user is looking at.) So in a very lame way I have found based on the current page they are on what is the previous page as well as the future page. Please tell me there is something less heinous than this solution.
protected void Page_Load(object sender, EventArgs e)
{
// Load the PageView for all page ordering.
FHLMSDAL.CollectionClasses.ViewPageOrder_Collection pages = new ViewPageOrder_Collection();
pages.GetMulti(null);
// Throw away variables
int count = 1;
int pg1 = 0;
int pg2 = 0;
int pg3 = 0;
foreach (ViewPageOrder_Entity page in pages)
{
// Add pageid to pgleft when there is a valid previous page
if (count > 2)
pg1 = pg2;
pg2 = pg3;
pg3 = Convert.ToInt32(page.PageId);
// if pg2 matches querystring then add variables
if(pg2 == Convert.ToInt32(this.Request.QueryString.Get("Id")))
{
pgLeft=pg1;
pgRight=pg3;
}
count = count + 1;
}
}
thanks,
Salterclan