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 | | | | re: Visual Studio .net template creation
"Brian Barnes" <spamme@nospam.com> wrote in message
news:%23sDsBiwjEHA.704@TK2MSFTNGP09.phx.gbl...[color=blue]
>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[/color]
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 | | | | re: Visual Studio .net template creation
"Brian Barnes" <spamme@nospam.com> wrote in message
news:uCVaMx8jEHA.2668@TK2MSFTNGP10.phx.gbl...[color=blue]
> "Brian Barnes" <spamme@nospam.com> wrote in message
> news:%23sDsBiwjEHA.704@TK2MSFTNGP09.phx.gbl...[color=green]
>>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[/color]
>
> 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.[/color]
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 | | | | re: Visual Studio .net template creation
"Brian Barnes" <spamme@nospam.com> wrote in message
news:e5OHYX9jEHA.1440@TK2MSFTNGP10.phx.gbl...[color=blue]
>
> "Brian Barnes" <spamme@nospam.com> wrote in message
> news:uCVaMx8jEHA.2668@TK2MSFTNGP10.phx.gbl...[color=green]
>> "Brian Barnes" <spamme@nospam.com> wrote in message
>> news:%23sDsBiwjEHA.704@TK2MSFTNGP09.phx.gbl...[color=darkred]
>>>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[/color]
>>
>> 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.[/color]
>
> 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[/color]
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 | | | | re: Visual Studio .net template creation
"Brian Barnes" <spamme@nospam.com> wrote in message
news:e0P5fS7kEHA.1936@TK2MSFTNGP12.phx.gbl...[color=blue]
>
> "Brian Barnes" <spamme@nospam.com> wrote in message
> news:e5OHYX9jEHA.1440@TK2MSFTNGP10.phx.gbl...[color=green]
>>
>> "Brian Barnes" <spamme@nospam.com> wrote in message
>> news:uCVaMx8jEHA.2668@TK2MSFTNGP10.phx.gbl...[color=darkred]
>>> "Brian Barnes" <spamme@nospam.com> wrote in message
>>> news:%23sDsBiwjEHA.704@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.[/color]
>>
>> 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[/color]
>
> 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?[/color]
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 |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,471 network members.
|