how do i add a new page using my theme's master page?

Topics: ASP.NET 2.0, Business Logic Layer
Feb 15, 2011 at 7:58 AM

If i'd like to add a page to the blog, such as a contact page with your typical contact form, how do i go about adding that to the site so that it uses the theme i put together? Not asking for help in actually making the contact form - i'm just not sure where to put the page and wire it up so that it fits in with my theme.

Feb 15, 2011 at 11:50 AM

After logging in, go to pages, add new page.

Feb 15, 2011 at 5:38 PM

well that's just too easy :)

The only problem with that though is i can't include any aspx code. For example, if i wanted to have that contact page with a contact form, i can't use this method. So is there some way for me to write my own aspx page and still have it use my theme's master page?


Feb 15, 2011 at 6:25 PM

It is simple if you are using VWD Express, just create a new aspx page and copy the BE code in the top so it picks up everything including the master page design and add whatever code you wish.  I have most of my website this way.


See here:

Feb 15, 2011 at 6:34 PM

So the current_hikes page on your site, that page is actually located in the root of your website, but it's using the master page located in /themes/yourtheme/ ?

I'll give that a try, thanks for the help.

Feb 15, 2011 at 6:36 PM
Edited Feb 15, 2011 at 6:36 PM

That is correct, do you use VWD Express 2010?

You need to have the BE code in there to pick up everything, did you notice that this page has no sidebar, there is code to do that if you need it.

Feb 15, 2011 at 6:39 PM
Edited Feb 15, 2011 at 6:40 PM

actually, no, i hadn't noticed that. Did you do something specifically to remove that? Basically, i want a page that looks exactly like the home page, except the space where the blogs posts would go, is where i'm going to put my content. And yes, i'm using VWD.

thanks again.

edit: actually, VSE 2010 is what i'm using, but that shouldn't matter since the code should be the same no matter which editor is being used.

Feb 15, 2011 at 6:48 PM

Like this one:

To remove the sidebar you can use this code in the .cs file

using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BlogEngine.Core;
using BlogEngine.Core.Web.Controls;

public partial class scheduled_hikes : BlogBasePage
    protected void Page_Load(object sender, EventArgs e)
        PlaceHolder phSidebar = Master.FindControl("phSidebar") as PlaceHolder;
        if (phSidebar != null)
            phSidebar.Visible = false;


Feb 15, 2011 at 6:56 PM

ah ok cool, so you had to do something special to remove the sidebar. Should make this easier for me since it should, in theory, just work :)

I'll give this a try later today. 

Thanks for your help.

Feb 16, 2011 at 7:28 AM

Just wanted to say i got this working with your suggestions. Thanks.

Feb 16, 2011 at 11:59 AM

Your welcome, I finally got a chance to pay back, I have received so much help here.  I am not a coder and have asked for a lot of special requests and have received help with them.

Feb 16, 2011 at 4:56 PM

yeah, same here. The dev is very helpful. More helpful then most commercial products.