Search code examples
asp.netcompilationweb-controls

Asp.net - does a compiler change the name of functions?


Does asp.net compiler change the name of public methods that are declared in a "web control" ???


Solution

  • It's a bit of a complex question!

    Asp.Net web sites can either be "Web Applications", normally fully compiled into .dlls, in which case the naming is fixed at compile time. C# and VB.Net are pretty good at keeping your names as declared.

    If you are running a "Web Site", there are different constraints around name-spacing which means that the compiler will have to 'guess' well-defined names (this often results in "ASP_.mytype" or similar.

    When it comes to naming on the client-side of a web site, your methods don't really exist anymore. Any user controls are 'rendered' into HTML, very often changing IDs to keep each unique. Returned results from a client-side post-back are mapped into a new instance of the page.

    Generally, the asp.net system plays a lot of tricks to make it seem like you have a long-term connection to the client-side; it takes some experience to know where they are.

    Hope that helps your frame your question.