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

  • Thread starter Thread starter Leeor Geva
  • Start date Start date
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!
 
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.
 
Back
Top