add page to blogengine

Nov 4, 2009 at 9:16 PM

so I am trying to add a registration page and a couple other random pages to my blogengine theme. I create the page set it up just like every other page on the theme link it to my site.master and place it in my root direcotyr. When i try to go to it, it says opps page can not be displayed. I tried disabling the 404 error in the web.config but it is already set to off.

 

Any ideas?

Nov 5, 2009 at 12:27 AM

Hi blbraner,

Just to (presumably) follow your process, I created pages in VS and added them to the "pages" folder, to the application root folder, and to the theme/mytheme folder.  Then I made a link to each of them in a link list.  Each was created with the site.master of my chosen theme as its master page.  I even put a gridview with some data in it to add some data access action <g>.  They all loaded up without complaint.  I did notice that I had to be careful about the path/ url... I got a couple of errors along the way because I'd typed it wrong.

Blogengine seems fairly accommodating, so maybe something is typed/spelled wrong somewhere?

-GayLyn

 

Nov 10, 2009 at 6:17 PM

I tried adding it to all the above directories and no luck. Is there a step by step process. even just being able to acces a blank page would be nice, then i could set it up from there. Basiclly I want to add a grid view to it to pull data from a mssql database based on a date query. feel like an idiot not being able toget the page to displayed lol

 

Nov 10, 2009 at 9:07 PM

hi,

Does "add page" mean  simply add an .aspx file to a BlogEngine website?

If that so codes below should work

in aspx side:

<%@ Page Language="C#" MasterPageFile="..."  CodeFile="..." Inherits="..." %>

<asp:content id="Content1" contentplaceholderid="ContentPlaceHolderForBodyFromSiteMaster" runat="server">

//contents

</asp:content>

 

in codebehind file:

public partial class mypage : BlogEngine.Core.Web.Controls.BlogBasePage
{

//codes...

}

 

Nov 11, 2009 at 2:44 AM

Hi blbraner,

Naw, don't feel like you're being singled out for struggle.  I've spent somewhere 'round 12 hours today struggling with cranky, cranky code and impossible database errors.  My, my, my... the woe and travail. <g>  So, lookey, if I post this step-by-step list for you here, some wonder coder is probably gonna get snarky and point out that I'm doing everything wrong.  So, when they do, you're gonna hafta be on my side, okay? I went through these steps:

Fired up VS 2005
Opened a Website
Clicked on the top line in Solution Explorer (which for me says "C:websites\BEThemeDev\")
Right-clicked on that "C:\websites\BEThemeDev\" and selected "Add New Item"
Selected "Webform"
Named it "somedata.aspx" ...
Made sure the "select master page" was checked
Clicked on Themes folder, the my current theme... then the Site.master file in it.
Clicked OK
That put my new file (somedata.aspx) in the root of the site.
From the toolbox, dragged a gridview into the content area
Connected the grid to a database... <clickity, click, click>
Right-clicked the page... View in browser... pulled up the theme as usual.
Noted the URL (make sure you take out the :#### <--numbers port designation cassini uses)
Opened up another browser to run the website in IIS rather than in the little Visual studio cassini server...
Put in the page's URL... it loaded up as it should.

 In my previous note, I was a little suspicious that maybe you had something awry in the URL.  I have this theory that 80% of my programming errors are naming or typing errors.

Hope it works.

-GayLyn 

Nov 12, 2009 at 2:00 AM

man i dont get it, i have followed both of these to a T, it looks fine inside of visual studio. So i add a test hyperlink to the page in the root directory upload it to the site and then click the link and I get a 404 error. I really do not understand

Nov 12, 2009 at 3:17 AM

Hi blbraner,

Seems to me you might have explained the problem.  I didn't follow the example through to the point of adding a link.  That could certainly be where your problem is. As above, I created a somedata.aspx page and placed it in the root directory.  Then, in my sidebar code of my chosen theme's site.master, I have the following link code:

            <div id="sidebar">
            <ul><li><h2>
            <asp:HyperLink ID="HyperLink1" NavigateUrl="~/somedata.aspx" runat="server">Somedata</asp:HyperLink></h2></li>
	   <li><h2>Some Link</h2></li>
            </ul>
            <div id="widgetzone" class="widget">
            <blog:WidgetZone ID="WidgetZone1" runat="server" />
            </div>
            </div><!-- close sidebar -->
... yes... I have become compulsive enough that I comment my </div> closings.  
My theory is that your trouble is in your link, and I'm stickin'with that.
-GayLyn
Nov 12, 2009 at 4:08 AM
Edited Nov 12, 2009 at 6:19 AM

man I got nothing....if you want my page is ironbarfitness.com the link is at the way bottom left corner....i took out the widgetzone as it doesnt seem that would be needs(plus it didnt work with it)  and just put in the hyperlink

i really dont get it, right now on the page there is just text in the content area stating this is just a test 

also i do appreciate all your help. and i do believe closing everything off is a great thing, first it elimates troubleshooint it, and no one can say oh you didnt do this

Nov 12, 2009 at 3:30 PM

Hi Brandon,

You'll need to upgrade to 1.5+ to do the widget zone thing.

Change the link.  It is now this:

<ul><li><h2>
     <a id="ctl00_HyperLink1" href="trainingpage.aspx">test 
     link</a></h2></li>
</ul>
It needs to be this:
          <ul><li><h2>
            <a id="ctl00_HyperLink1" href="~/trainingpage.aspx">test 
              link</a></h2></li>
            </ul>
Somehow, I think that is not the entire problem.  
If I cannot retrieve the page with this:
http://www.ironbarfitness.com/trainingpage.aspx?theme=standard
(having removed any goofiness connected with the theme or the link, and reverted to the standard theme), it may not be where you think it is.  
Make a page with a totally different/easy/absolutely-couldn't-be-a-duplicate name and make sure it's in the root folder, the same folder as archive.aspx, contact.aspx, error404.aspx.  And make sure you have the "~/" in the link.
Why does your theme open all the pages in a new window? Even the links in the top menu? Maybe a _target attribute is complicating this link problem?
You're going to make it work, aren't you?
-GayLyn
Nov 14, 2009 at 4:30 AM

man I really dont know. they are in the same location(which is the root) with the archive and error404

made a new page called test and linked to it, really dont know

Nov 17, 2009 at 2:00 AM

I really dont get it, i even just try to add an adrotator to the master page and i then get a error when the pages loads....