Protected Shadows With Events.

T

Tony Doyle

Has anybody come across this before...

Basically my issue is this.

In ASP.NET I have a Class module, functions.vb

This inherits from System.Web.UI.Page

In order to use the controls function inside this class, I have used the
following line

Protected WithEvents phTopmostFloat As
System.Web.UI.WebControls.PlaceHolder

And declared this at the top of the module

Inside any .net aspx page, if I inherit from functions.vb instead of
system.web.ui.page, when I want to use my place holder control, I put it on
the page and the

Protected WithEvents phTopmostFloat As
System.Web.UI.WebControls.PlaceHolder

Is then also declared locally in the code behind which then gives errors on
run.

The only way to run the page is to delete the lines in the code behind, the
dynamic help advises to use the Shadows keyword, but this doesn't seem to
work i.e

Protected Shadows WithEvents phTopmostFloat As
System.Web.UI.WebControls.PlaceHolder

Can anyone help me solve this issue...

Cheers

Td
 
T

Tony Doyle

How do I define this in code then...

Im no expert either, just beginning, but this doesnt seem to make sense...

Td
 
M

Mythran

Tony Doyle said:
How do I define this in code then...

Im no expert either, just beginning, but this doesnt seem to make sense...

Td

You have it marked as Protected in the base file. Therefore, you
"shouldn't" need it defined in the derived class (code-behind). Try
removing it from the derived class and still try accessing from the derived
class. It "should" work.

Mythran
 
T

Tony Doyle

Cheers Myhran,

But there in lies the problem, I dont have it in the code behind, however
Visual Studio every time you open the page adds it into the Web designer
section by its own free will, this then causes it to crash.
Any ideas on how to stop it getting put in?

Cheers

Td
 
M

Mythran

Tony Doyle said:
Cheers Myhran,

But there in lies the problem, I dont have it in the code behind, however
Visual Studio every time you open the page adds it into the Web designer
section by its own free will, this then causes it to crash.
Any ideas on how to stop it getting put in?

Cheers

Td

Ouch...no.

That stinks.

Sorry I could not be more help.

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top