tags:

views:

203

answers:

1
var product = db.Products.First(p => p.Id == 5);

In the product detail show page, show.aspx?Id=5, I want to get the previous and next product link.

How can I do that?

Should I connect to the database three times to get the current product and previous id and next id for generate links?

A: 

I have solved this problem by returning two entities.

Mike108