473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Visual Studio .net template creation

I am trying to create a template code behind file for a website which all
pages should be inherited from. This base class however, when I try to view
the aspx page in Visual studio .NET (2002), it gives me the error:

The file failed to load in the web form designer. Plese correct the
following error, then load it again: An exception occurred while trying to
create an instance of GManWebSync.templates.WebBase (the base class). The
exception was "Object reference not set to an instance of an object."

Despite the fact that the file displays as expected in the web browser. I am
able to view the html code of the page so is more of a nusance. I have moved
the header html tag to be written from the template, however I have not
taken out the header section of all the pages yet (but this problem occurs
with all pages). I am sure that all varibles are initialised before they are
used (assuming "titlebar = CType(LoadControl(Request.ApplicationPath &
"/Components/comtop.ascx"), comTop)" initalises titlebar) as it compiles and
functions as expected

The page structure is going to be a title bar (initialised with the above
line) and then a table with 2 columns with a menu in the left column
(currently not shown (as I am having difficulties including it), but
designed as a component) and a maintaince side in the right (in which my
manager wants to have some changes reflected in the menu e.g. changing a
users name will change the link in the left menu) . The template is designed
to have the code to write the header information, include the title bar (it
is a basic component), write the table, include the menu, write the
maintaince page (which inherits the template page) and close the table and
body.

Any suggestions as to what I should look at closer
--
Brian Barnes
Nov 18 '05 #1
4 1663
"Brian Barnes" <sp****@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I am trying to create a template code behind file for a website which all
pages should be inherited from. This base class however, when I try to view
the aspx page in Visual studio .NET (2002), it gives me the error:

The file failed to load in the web form designer. Plese correct the
following error, then load it again: An exception occurred while trying to
create an instance of GManWebSync.templates.WebBase (the base class). The
exception was "Object reference not set to an instance of an object."

Despite the fact that the file displays as expected in the web browser. I
am able to view the html code of the page so is more of a nusance. I have
moved the header html tag to be written from the template, however I have
not taken out the header section of all the pages yet (but this problem
occurs with all pages). I am sure that all varibles are initialised before
they are used (assuming "titlebar =
CType(LoadControl(Request.ApplicationPath & "/Components/comtop.ascx"),
comTop)" initalises titlebar) as it compiles and functions as expected

The page structure is going to be a title bar (initialised with the above
line) and then a table with 2 columns with a menu in the left column
(currently not shown (as I am having difficulties including it), but
designed as a component) and a maintaince side in the right (in which my
manager wants to have some changes reflected in the menu e.g. changing a
users name will change the link in the left menu) . The template is
designed to have the code to write the header information, include the
title bar (it is a basic component), write the table, include the menu,
write the maintaince page (which inherits the template page) and close the
table and body.

Any suggestions as to what I should look at closer


It appear that this problem is a Visual Studio corruption problem as I went
to a backup of this site (before I first saw this error) and am still having
the problem. I am doing a repair install at present and will let you know
how it goes.

--
Brian Barnes
No Spam Proof e-mail
Use News Groups
Nov 18 '05 #2

"Brian Barnes" <sp****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
"Brian Barnes" <sp****@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I am trying to create a template code behind file for a website which all
pages should be inherited from. This base class however, when I try to
view the aspx page in Visual studio .NET (2002), it gives me the error:

The file failed to load in the web form designer. Plese correct the
following error, then load it again: An exception occurred while trying
to create an instance of GManWebSync.templates.WebBase (the base class).
The exception was "Object reference not set to an instance of an object."

Despite the fact that the file displays as expected in the web browser. I
am able to view the html code of the page so is more of a nusance. I have
moved the header html tag to be written from the template, however I have
not taken out the header section of all the pages yet (but this problem
occurs with all pages). I am sure that all varibles are initialised
before they are used (assuming "titlebar =
CType(LoadControl(Request.ApplicationPath & "/Components/comtop.ascx"),
comTop)" initalises titlebar) as it compiles and functions as expected

The page structure is going to be a title bar (initialised with the above
line) and then a table with 2 columns with a menu in the left column
(currently not shown (as I am having difficulties including it), but
designed as a component) and a maintaince side in the right (in which my
manager wants to have some changes reflected in the menu e.g. changing a
users name will change the link in the left menu) . The template is
designed to have the code to write the header information, include the
title bar (it is a basic component), write the table, include the menu,
write the maintaince page (which inherits the template page) and close
the table and body.

Any suggestions as to what I should look at closer


It appear that this problem is a Visual Studio corruption problem as I
went to a backup of this site (before I first saw this error) and am still
having the problem. I am doing a repair install at present and will let
you know how it goes.


Well it didn't go to well, I still have the same problem. The backup does
not work, nor does the original (although another website I am working on
does). I am sure that when I took the backup, there was no problem
--
Brian Barnes
No Spam Proof e-mail
Use News Groups
Nov 18 '05 #3

"Brian Barnes" <sp****@nospam.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...

"Brian Barnes" <sp****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
"Brian Barnes" <sp****@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I am trying to create a template code behind file for a website which all
pages should be inherited from. This base class however, when I try to
view the aspx page in Visual studio .NET (2002), it gives me the error:

The file failed to load in the web form designer. Plese correct the
following error, then load it again: An exception occurred while trying
to create an instance of GManWebSync.templates.WebBase (the base class).
The exception was "Object reference not set to an instance of an
object."

Despite the fact that the file displays as expected in the web browser.
I am able to view the html code of the page so is more of a nusance. I
have moved the header html tag to be written from the template, however
I have not taken out the header section of all the pages yet (but this
problem occurs with all pages). I am sure that all varibles are
initialised before they are used (assuming "titlebar =
CType(LoadControl(Request.ApplicationPath & "/Components/comtop.ascx"),
comTop)" initalises titlebar) as it compiles and functions as expected

The page structure is going to be a title bar (initialised with the
above line) and then a table with 2 columns with a menu in the left
column (currently not shown (as I am having difficulties including it),
but designed as a component) and a maintaince side in the right (in
which my manager wants to have some changes reflected in the menu e.g.
changing a users name will change the link in the left menu) . The
template is designed to have the code to write the header information,
include the title bar (it is a basic component), write the table,
include the menu, write the maintaince page (which inherits the template
page) and close the table and body.

Any suggestions as to what I should look at closer


It appear that this problem is a Visual Studio corruption problem as I
went to a backup of this site (before I first saw this error) and am
still having the problem. I am doing a repair install at present and will
let you know how it goes.


Well it didn't go to well, I still have the same problem. The backup does
not work, nor does the original (although another website I am working on
does). I am sure that when I took the backup, there was no problem


Now this is really getting confusing. My web service .asmx and .asmx.vb
files (when double clicking on them in the solution explorer) come up with
the error:

An exception occurred while trying to create an instance of GManWebSync.Base
(the Base class for the web service, not to be confused with
GManWebSync.templates.webBase). The exception was "HttpContext is not
available. This class can only be used in the context of an ASP.NET
request".

Despite the fact that the web service works as per normal (on both a backup
(that was taken before the original error, and was working perfectly) and my
most recent version), and another web site (as a completely different
project) has no issues whatsoever. I can however right click the file and
select view code to see the code. The only change to the system that I have
done is XP service pack 2.

Any idea's before I have to re-create the project?
--
Brian Barnes
No Spam Proof e-mail
Use News Groups
Nov 18 '05 #4
"Brian Barnes" <sp****@nospam.com> wrote in message
news:e0**************@TK2MSFTNGP12.phx.gbl...

"Brian Barnes" <sp****@nospam.com> wrote in message
news:e5**************@TK2MSFTNGP10.phx.gbl...

"Brian Barnes" <sp****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
"Brian Barnes" <sp****@nospam.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
I am trying to create a template code behind file for a website which
all pages should be inherited from. This base class however, when I try
to view the aspx page in Visual studio .NET (2002), it gives me the
error:

The file failed to load in the web form designer. Plese correct the
following error, then load it again: An exception occurred while trying
to create an instance of GManWebSync.templates.WebBase (the base
class). The exception was "Object reference not set to an instance of
an object."

Despite the fact that the file displays as expected in the web browser.
I am able to view the html code of the page so is more of a nusance. I
have moved the header html tag to be written from the template, however
I have not taken out the header section of all the pages yet (but this
problem occurs with all pages). I am sure that all varibles are
initialised before they are used (assuming "titlebar =
CType(LoadControl(Request.ApplicationPath & "/Components/comtop.ascx"),
comTop)" initalises titlebar) as it compiles and functions as expected

The page structure is going to be a title bar (initialised with the
above line) and then a table with 2 columns with a menu in the left
column (currently not shown (as I am having difficulties including it),
but designed as a component) and a maintaince side in the right (in
which my manager wants to have some changes reflected in the menu e.g.
changing a users name will change the link in the left menu) . The
template is designed to have the code to write the header information,
include the title bar (it is a basic component), write the table,
include the menu, write the maintaince page (which inherits the
template page) and close the table and body.

Any suggestions as to what I should look at closer

It appear that this problem is a Visual Studio corruption problem as I
went to a backup of this site (before I first saw this error) and am
still having the problem. I am doing a repair install at present and
will let you know how it goes.


Well it didn't go to well, I still have the same problem. The backup does
not work, nor does the original (although another website I am working on
does). I am sure that when I took the backup, there was no problem


Now this is really getting confusing. My web service .asmx and .asmx.vb
files (when double clicking on them in the solution explorer) come up with
the error:

An exception occurred while trying to create an instance of
GManWebSync.Base (the Base class for the web service, not to be confused
with GManWebSync.templates.webBase). The exception was "HttpContext is not
available. This class can only be used in the context of an ASP.NET
request".

Despite the fact that the web service works as per normal (on both a
backup (that was taken before the original error, and was working
perfectly) and my most recent version), and another web site (as a
completely different project) has no issues whatsoever. I can however
right click the file and select view code to see the code. The only change
to the system that I have done is XP service pack 2.

Any idea's before I have to re-create the project?


Recreation didn't work. However, I now have a work around. Whenever I want
to go into design mode, I have it inherit page (as opposed my page template
base class).

I'm still looking for a more perminant solution.
--
Brian Barnes
No Spam Proof e-mail
Use News Groups
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg B | last post by:
Created a simple Win32 application (using Visual Studio wizard)... Am using Visual Studio (Enterprise Edition) 6.0, as well as Service Pack 5. At the start of 'WinMain' function, added the...
19
by: Alf P. Steinbach | last post by:
// As usual the error message directs one to the report the bug. // // And as usual there is absolutely no way to do so without paying for // the privilege... // // Or using three or four hours...
5
by: Somesh | last post by:
#include<map> #include<iostream> #include<string> using namespace std; int main() { map <string,int> test;
5
by: Daniele | last post by:
Hi, how is it possible to create a project with a specific template, compile it and close it? All with a c# script. Thanks, Daniele
1
by: Mark | last post by:
Hopefully somebody can help me with this very frustrating problem. In Dreamweaver I have a template page and a page created from this template called Home.aspx. In Visual Studio I have a class...
0
by: fiona | last post by:
Innovasys Ltd., a leader in help authoring and documentation tools, today announced the inclusion of a tailored version of the Innovasys HelpStudio help authoring product, HelpStudio Lite, in the...
1
by: KevinGPO | last post by:
My application was developed under Visual C++ 6.0, ATL, MFC & PlatformSDK Feb2003 (the last VC6 compatible version). I am wondering if PlatformSDK Feb2003 is compatible with Visual Studio.NET...
2
by: terry.trent | last post by:
I'm new to c# and Visual C# Express, and to normal programming in general (some background in web programming), and i have a question vital to my current project. Basically, i have been asked to...
0
by: fiona | last post by:
Reading, Berkshire, UK 05 June 2007 - Crainiate Software make details available of the release of Objecto Framework 2.0, an upgrade to their enterprise business component framework, designed to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.