Web Form Designer Generated Code - Get Me Outta Here!! :-)

L

Leeor Geva

Hey guys,

how do I make a control PUBLIC inside the Web Form Designer Generated Code?

What happens is that I make it public, i Run the solution, it works
perfectly fine. Then for some reason unknown to me, VS.Net flips it back
from public to protected (This:

Public WithEvents dcpMain As
DBauer.Web.UI.WebControls.DynamicControlsPlaceholder

To

Protected WithEvents dcpMain As
DBauer.Web.UI.WebControls.DynamicControlsPlaceholder



When it feels like it.

So how can I do this? :-/

Thanks!
 
J

John Saunders

Leeor Geva said:
Hey guys,

how do I make a control PUBLIC inside the Web Form Designer Generated Code?

What happens is that I make it public, i Run the solution, it works
perfectly fine. Then for some reason unknown to me, VS.Net flips it back
from public to protected (This:

Public WithEvents dcpMain As
DBauer.Web.UI.WebControls.DynamicControlsPlaceholder

To

Protected WithEvents dcpMain As
DBauer.Web.UI.WebControls.DynamicControlsPlaceholder

If the designer put the "Protected" definition there to begin with, then why
wouldn't the designer do the same thing again, given the same input data?

Besides, don't expose public fields. Expose a public property which returns
the protected or private field.
 

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,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top