Did you still need help with this?
If so, are you speaking of the following 2 possible scenarios:
1) You are on a page, and want to (via code) know the Template name of that page
2) You are on a page, and want to (via code) know the Template name of another page
Somen De | Sr. Consultant
Do you still need help with this?
Hope you have got the answer you are looking for, if not have you tried some thing like this?
<asset:load name="MyPage" type="Page" objectid='<%=pageID%>'/>
<asset:get name="MyPage" field="template" output="templateName"/>
In case you just need template name and you don't want to load your asset, you can use <asset:list/> tag. It will only query asset table and will retrieve all the info abased on the criteria. In your case, you can use it in following way:-
<asset:list type="Page" list="pagelist" field1="id" value1="pageid"/>
<ics:listget listname="pagelist" fieldname="template"/>