HTML and CSS Reference
In-Depth Information
orderby item.Id ascending
select item).Take(1);
data = from item in db.Images
where item.Id == id
select item;
return View(data.SingleOrDefault());
The Index() action method now checks whether an image ID is passed. If so, it returns an image with
the specified ID; otherwise the first image from the database is returned.
Figure 6-4 shows a sample run of the modified Slide Show application. Notice how the browser
address bar is showing a unique URL for every slide.
Figure 6-4. HTML5 pushState() method changing the URL in the address bar
The browser's history menu or dialog also lists the URLs added via the pushState() method, as shown
in Figure 6-5.
Figure 6-5. The browser's history dialog showing URLs added via the pushState() method
Search WWH ::

Custom Search