Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what rules does designer.cs generation use

Tags:

c#

asp.net

Folks,

what are the rules governing the generation of declarations in the designer.cs file in an asp.net project?

for example, I have
- myfile.resx,
- myfile.aspx,
- myfile.aspx.cs.

these generate
- myfile.aspx.designer.cs

which defines things like protected global::system.web.ui.webcontrols.literal blahblah; for my resources.

but until I reference something in myfile.aspx, it wont show up in the generated designer.cs, even if I'm refering to it in my myfile.cs (the codebehind class).

how can I force this, without taking ownership of that designer.cs file?

context: I have a someresource.text in my aspx, which i am constructing out of a bunch of other resources, which is why they dont show up explicitly in the aspx.

like image 540
Oren Mazor Avatar asked Nov 15 '22 09:11

Oren Mazor


1 Answers

The only declarations within a designer file are for the server side controls explicitly declared on the aspx during design time. AFAIK, absolutely nothing else will be added to the designer file.

Remember, the designer file is only a partial class that specifically declares controls for use in your code-behind (which is also a partial class). It is only there to aid wiring up all your controls.

like image 196
Mike Cellini Avatar answered Dec 08 '22 14:12

Mike Cellini