asp.net page template *inheritance)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: John Boers (jj.boers_at_hccnet.nl)
Date: 05/28/04


Date: Fri, 28 May 2004 21:47:24 +0200

I am trying to create a template for my website. But I have a problem, the
system says BC30469: Reference to a non-shared member requires an object
reference and points to the statement PageBase.Render( writer ).

I create the template by overriding the System.Web.UI.Page.Render method.
Then in every page I refer to the designed template. Please explain to me
where I go wrong.

Look here for the live errormessage:
http://johnboers.europe.webmatrixhosting.net/template.aspx

I use two files, see below.

Thank you for your time,

John

The files
Template.aspx
---
<% @Page Language="VB" AutoEventWireup="true" src="template.vb"
Inherits="PageBase" %>

<form id="pagecontent" method="post" runat="server">

<B> the content in HTML </B>
It should appear.

</form>
---

and template.vb
---
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls

Public Class PageBase
inherits System.Web.UI.Page
protected overrides sub Render(writer as HTMLTextWriter)

' First we will build up the html document,
' the head section and the body section.
writer.Write( "<html><head><title>John's test
pagina</title></head><body>example text" )

' Then we allow the base class to render the
' controls contained in the ASPX file.
PageBase.Render( writer )

' Finally we render the final tags to close
' the document.
Writer.Write( "</body></html>" )
end sub
end class
---



Relevant Pages

  • Re: asp.net page template *inheritance)
    ... I have to use the render method of mybase, but I never declare or import ... MyBase so where is it defined? ... >> I create the template by overriding the System.Web.UI.Page.Render method. ... >> Imports System.Web.UI ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem runnig macros
    ... Do File> Open to open your template. ... Un-tick the box that says it's a broken reference. ... use the Project Explorer to click on each open ... however when I try to run the macro it says runtime error 5891 could ...
    (microsoft.public.word.vba.general)
  • Re: Avoiding ActiveDocument
    ... object reference when a file is first opened or added. ... Set myDoc = ActiveDocument ... modifying the in-memory copy of the template, ... dim oDoc as Document ...
    (microsoft.public.word.vba.general)
  • Re: Cannot add reference to Word template project via Automation
    ... I have previously tried opening the template directly and using ... > docTemplate as a new template based on Normal, ... > Dim objTemplate as Template ... >> Without using Automation, I can delete a reference, then recreate the ...
    (microsoft.public.office.developer.automation)
  • Re: Cannot add reference to Word template project via Automation
    ... I have previously tried opening the template directly and using ... > docTemplate as a new template based on Normal, ... > Dim objTemplate as Template ... >> Without using Automation, I can delete a reference, then recreate the ...
    (microsoft.public.word.vba.general)