Full example in detail is present here.
Walkthrough: Creating Master/Detail Web Pages in Visual Studio
This walkthrough shows you various ways to work with data in multiple controls and from multiple tables, including those that have a master/detail relationship.
Refer this link:
http://msdn.microsoft.com/en-us/library/stc0szde.aspx