Reflection and aspx pages

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Is there any way I can "load" an aspx file and examine, which controls are
on the page. A little bit like reflection? Regards, Chris.
 
Actually this is pretty close to what is done with MS ASP.NET AJAX and
similar frameworks like Anthem.Net. XMLHTTP calls are made to the page, the
page is processed through it's lifecycle on the server, and page methods are
called, with the results being marshaled via JSON back to the caller.

When you "Load" an aspx "file" what you are doing is allowing it to create
an instance of the Page class for that specific page. You can certainly do
this via Reflection API as well, since the codebehind for each page (at least
in a Web Application Project) is all compiled into the single assembly in the
/bin folder.

The .ASPX portion is normally compiled into a temporary assembly that
resides in the ASP.NET temporary files folder under the Windows
/Microsoft.NET/Framework/XXX / ASP.NET Temporary Files ... folder.

The bigger question here is : "What is the goal?" What are you trying to
accomplish, and why? There may very well be an easier way.
Peter
 
I am designing a system where we can dyanamically create forms and link them
to a business layer and then onto stored procedures. This is all acheived by
xml config files which we use to determine which property is associated with
each control etc.

Some of the way I was thinking of doing it, was to bind groups of controls
to placeholder controls on the page so the web designers could just assign
areas of their layouts to groups of controls. In our application that
designs the config file it would be nice to point it at a aspx page, and say
their are two placeholders which will have controls x, y and z added to
them.
 
Back
Top