Help Needed!

I am developing an attendance checker application for Windows Phone 7.
The app basically checks for your attendance % individually for each subject and lets you know if you should attend more lectures.
In one of the navigation pages, I am planning on asking the user to input the subject name in a text box. Based on this String, I will create a button for that particular subject name in another page. The user will then click this button and he will be navigated to the attendance of that particular subject, where he can set the attendance he has and the total attendance.
My problem is, I cannot figure out that when I accept the name of the subject, how will i create a button with that name.
The button should be created only after the user confirms the name of the subject.
Any help is highly appreciated.