By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,245 Members | 1,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,245 IT Pros & Developers. It's quick & easy.

Visual Studio .net template creation

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
"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

P: n/a

"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

P: n/a

"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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.