Converting a web form form to web content after the fact. (.net)

I have a site for several years containing about 30 aspx web form pages with code behind. I want to add a generic master page to all of these with a minimum amount of work.

Basically I just need to add everything to the body tags in the Content Placeholder and save the code.

Is there a quick way to do this?

0


source to share


3 answers


For each page, do the following - Add an attribute to the <@Page> tag named MasterPageFile = "Your MasterPage Path" - Add the following tag - Remove the html and head tags and their content, except for the body tag - Remove the body tags BUT KEEP its connotations - Remove Form Tag - Done



+2


source


cut and paste small files - cut all old header / footer elements and paste in content control tag and add the master page name and you're done



+1


source


One thing to keep in mind is when you add a master page to which you add a naming container so that all your client IDs change. If you have static javascript that is bound to your controls, be sure to update the ids.

+1


source







All Articles