Convert ASPX to Contentpage

This weekend i had a little bit of time and a idea in mind.

I always miss the feature to convert a existing page to use a masterpage. So i have done my first:

  1. vs2005 Winforms
  2. VS Addin
  3. setup package

You can download it, us it for free without any warranty and give me feedback. If you are realy intressted i can give you the source for making a review and polish up. After that i will post the source code also.

At the moment you can download the addin msi package

The Addin is installed at tools menu first position

Published Monday, February 06, 2006 8:26 AM by preishuber

Comments

# re: Convert ASPX to Contentpage

Wednesday, July 12, 2006 5:49 PM by dominic turner

VS 2005 just crashes every time i run it. Mmmmn. Wouldn't mind knowing how you do it manually....

# re: Convert ASPX to Contentpage

Thursday, July 13, 2006 3:46 AM by dominic turner

Ahh - just worked it out - must have been too tired last night to spot it.

To manually convert a page to a contentpage simply:

1) Remove HTML HEAD & BODY

2) Insert ASP:CONTENT TAG

3) Insert MasterPageFile attribute in @PAGE directive

here is an example content page

===============================================

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" ValidateRequest="false" MasterPageFile="~/TestMasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<!-- Original rest of page goes here -->

</asp:Content>

===============================================

N.B. You will need to make sure that the ContentPlaceHolder ID matches the ContentPlaceHolder ID in the master page (in this case TestMasterPage.master has a control called ContentPlaceHolder1)

===============================================

It would be nice to have a tool to do this for you - unfortunately this tool crashes VS on my laptop. Might just be me.

# re: Convert ASPX to Contentpage

Wednesday, October 18, 2006 6:52 AM by Joe Schmo

Tried it on a couple of pages. It does seem to work however it seems you must have the page to be converted showing "Source" rather than "Design".

Also, you may have to manually change the ContentPlaceHolderID tag.

Otherwise, great. Thanks!

# re: Convert ASPX to Contentpage

Monday, September 21, 2009 12:22 PM by Michael Herman

I'm interested in improving this add-on ...at least removing the HEAD and BODY tags.

Please contact me by email mwherman2000 hotmail

Leave a Comment

(required) 
(required) 
(optional)
(required)