Then on the asp web pages for the site add put all the code in content tags setting the contentplaceholderID attribute to the id of the contentplaceholder in the master page.
<asp:content id="Content1" runat="Server" contentplaceholderid="ContentPlaceHolder1">
When the browser requests the page the content in the content tag of the asp page will be inserted into the master page at a point according to the contentplaceholder ID. The approach is flexible because it allows for lots of options in the places the data is inserted into the main page. For example you could have two different point in the master file where code was inserted.