Change default.aspx name

Jan 14, 2008 at 8:25 AM
The main blog page is default.aspx. Is it possible to change the name of this as I dont want default.aspx to be the main homepage of my site?
Jan 14, 2008 at 9:48 AM
Hi there, yes it is possible. The easiest way is the highlighted quote from a similar post.

In Does BlogEngine.net need its own page? MikevZ wrote:
No, BlogEngine.NET does not require its own (default.aspx) page, just the code behind .cs file.
Yes, you can integrate BlogEngine.NET into an existing site.

Several options you might try:

  1. Replace BlogEngine's default.aspx with your existing page and use blog.aspx for integration purposes, e.g.:
    1. IFrame workaround as Ivildosola pointed out
    2. Screen scraping techniques (still quick & dirty)
    3. Streaming the RSS feed items (more elegant)
  2. Transform your current website layout into a BE.NET theme, then:
    1. Add a BlogEngine page with your homepage content
    2. Set this page as FrontPage via the admin interface
    3. Link to blog.aspx to serve your visitors the blog posts
  3. Create your very own page and inherit from BlogEngine:

<%@ Import Namespace="BlogEngine.Core" %>
<%@ Page Language="VB or C#" Title="Your Own Cool Page" Inherits="BlogEngine.Core.Web.Controls.BlogBasePage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">
<h1>Your Own Page</h1>
<p>Inheriting the cool layout and benefits from BlogEngine.NET
</asp:Content>



Please check out this posted discussion for the full thread.
Jan 14, 2008 at 12:40 PM

MikevZ wrote:
Hi there, yes it is possible. The easiest way is the highlighted quote from a similar post.

In Does BlogEngine.net need its own page? MikevZ wrote:
No, BlogEngine.NET does not require its own (default.aspx) page, just the code behind .cs file.
Yes, you can integrate BlogEngine.NET into an existing site.

Several options you might try:

  1. Replace BlogEngine's default.aspx with your existing page and use blog.aspx for integration purposes, e.g.:
    1. IFrame workaround as Ivildosola pointed out
    2. Screen scraping techniques (still quick & dirty)
    3. Streaming the RSS feed items (more elegant)
  2. Transform your current website layout into a BE.NET theme, then:
    1. Add a BlogEngine page with your homepage content
    2. Set this page as FrontPage via the admin interface
    3. Link to blog.aspx to serve your visitors the blog posts
  3. Create your very own page and inherit from BlogEngine:

<%@ Import Namespace="BlogEngine.Core" %>
<%@ Page Language="VB or C#" Title="Your Own Cool Page" Inherits="BlogEngine.Core.Web.Controls.BlogBasePage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">
<h1>Your Own Page</h1>
<p>Inheriting the cool layout and benefits from BlogEngine.NET
</asp:Content>



Please check out this posted discussion for the full thread.


Thanks for this. Could explain what you mean in the step - 3. Link to blog.aspx to serve your visitors the blog posts? Thanks.
Jan 15, 2008 at 2:26 PM
Hi, thank you for letting me further explain this blog.aspx in step 3:

By default, BlogEngine.NET shows your 10 (or so) last posts on the home/front page (/default.aspx), right?
Let's call this view mode "dynamic" for easier reference later only.

BE.NET also allows you to set one of your pages as front page instead of the dynamic view.
This way, every time a visitor browse to your home page, he/she will see this static front page.

Now if you use this static front page option, you can still show your visitors the dynamic view. How?
Instead of pointing them to default.aspx on your site, you can offer them the link to blog.aspx

Check out these working examples to see it in action:
http://www.dotnetblogengine.net/blog.aspx
http://blog.madskristensen.dk/blog.aspx
http://www.razorant.com/blog/blog.aspx

Please note: blog.aspx is not a physical file, but a virtual URL rewrite feature build in BlogEngine.NET.

Does that answer your question?
Mike
Jan 16, 2008 at 11:08 AM

MikevZ wrote:
Hi, thank you for letting me further explain this blog.aspx in step 3:

By default, BlogEngine.NET shows your 10 (or so) last posts on the home/front page (/default.aspx), right?
Let's call this view mode "dynamic" for easier reference later only.

BE.NET also allows you to set one of your pages as front page instead of the dynamic view.
This way, every time a visitor browse to your home page, he/she will see this static front page.

Now if you use this static front page option, you can still show your visitors the dynamic view. How?
Instead of pointing them to default.aspx on your site, you can offer them the link to blog.aspx

Check out these working examples to see it in action:
http://www.dotnetblogengine.net/blog.aspx
http://blog.madskristensen.dk/blog.aspx
http://www.razorant.com/blog/blog.aspx

Please note: blog.aspx is not a physical file, but a virtual URL rewrite feature build in BlogEngine.NET.

Does that answer your question?
Mike


Mike, thank you very much for you assistance. I understand what you mean now.

1 final question, if i want to use one of my own pages and not a BE.net page as my front page, how can i configure it? I have my own page inheriting from BlogEngine.Core.Web.Controls.BlogBasePage but unsure where to go from here.
Jan 16, 2008 at 6:59 PM
Hi, could you please tell a bit more about your own page? Like, what should it do, show and/or inherit?
So hopefully we can try to answer your "How to configure" question.

I'm sorry for not having an immediate answer yet. Thanks in advance for providing more background!

-Mike


Amateur wrote:
Mike, thank you very much for you assistance. I understand what you mean now.

1 final question, if i want to use one of my own pages and not a BE.net page as my front page, how can i configure it? I have my own page inheriting from BlogEngine.Core.Web.Controls.BlogBasePage but unsure where to go from here.

Jan 17, 2008 at 8:47 AM

MikevZ wrote:
Hi, could you please tell a bit more about your own page? Like, what should it do, show and/or inherit?
So hopefully we can try to answer your "How to configure" question.

I'm sorry for not having an immediate answer yet. Thanks in advance for providing more background!

-Mike


Amateur wrote:
Mike, thank you very much for you assistance. I understand what you mean now.

1 final question, if i want to use one of my own pages and not a BE.net page as my front page, how can i configure it? I have my own page inheriting from BlogEngine.Core.Web.Controls.BlogBasePage but unsure where to go from here.



Thanks Mike.

My page is just a normal .aspx page that inherits from BlogEngine.Core.Web.Controls.BlogBasePage and displays content not related to the BlogEngine, for example product information. Its called newpage.aspx for example. I want to set this page as my FrontPage.

Does this help? Thanks again!
Jan 23, 2008 at 11:57 PM
Hi and sorry for this delayed response.

Wish I could help you further, but I'd need a better understanding of what direction you're going.
Perhaps we could talk this over instead of typing/replying back and forth?

As an alternative, would it be possible to just reuse the BE.NET default.aspx and paste any of your content in it?
Cause basically there's nothing much in that file, it's all in the code-behind (default.aspx.cs)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="_default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">
 
**paste here whatever you like, like what's already in a newpage.aspx **
 
</asp:Content>

Some other community member who can shed some fresh light on this?
Jul 3, 2009 at 5:28 AM

I think I have a working example of what Amateur was trying to do.

here is some code that uses the blogengine controlls and then access some of the non blogengine controls. This example is a downoad page.

the first part is download.aspx.cs

________________________________________________

using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using BlogEngine.Core;
using BlogEngine.Core.Web.Controls;
using System.Net.Mail;
using System.Text.RegularExpressions;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.IO;


public partial class download : BlogBasePage
{
        
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
        protected void Button2_Click(object sender, EventArgs e)
        {
        // Some code here. whatever you are trying to accomplish


        }


}

_________________________________

 

download.aspx

___________________________________

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="download.aspx.cs" Inherits="download" ValidateRequest="false" %>
<%@ Import Namespace="BlogEngine.Core" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphBody" Runat="Server">
 
  <asp:Button ID="Button2" runat="server" onclick="Button2_Click"
        Text="Start Download" Width="158px" />
 
</asp:Content>

_________________________

I got to this point by hacking contact.aspx and contact.aspx.cs  and then of course put the <a id="A2" href="~/download.aspx" runat="server">Download</a> By the other links in site.master

I spent about 6-8 hours on this. I sould of gave up on google after 20 minutes and worked it out myself.

 

Feb 1, 2011 at 1:39 PM

Can anyone explain how I do 2.

Set this page as FrontPage via the admin interface

Can't find this option anywhere 

 

Thanks in advance

Feb 1, 2011 at 1:56 PM

Edit the page you wish to be the Front page and the checkbox is at the top right to make it a Front page.

Feb 1, 2011 at 2:06 PM

Jerry,

 

Thanks for the prompt response, as stupid as this may sound can you explain where the check box in the top right is?

i'm using VWD 2008 if that makes a difference.

Thanks in advance

Feb 1, 2011 at 5:33 PM

Do this though your web browser, with BE 2.0 you login, click on pages, then the page that you want to be the front page or create the page, with that page open click on edit and the checkbox is there.