with Dreamweaver templates, you can either add server side behaviors to the template, or you can add server side behaviors to the pages based on the template. you cant do both. this is a limitation to the template engine of Dreamweaver.
the work around is to convert the template to a framework builder theme. There is a tutorial for themes on the DEsign Extender support page.