N
Nick
Hi,
I have asked this question in a few guises recently, and not had much
response. But I dont think what I am asking is too obscure, so I am hoping
I just need to rephrase.
When a view is rendering itself (say Foo.aspx/Foo.aspx.cs), during rendering
it realises it needs a secondary view to do something (lets call it
Bar.aspx/Bar.aspx.cs). The logic is somehting like:
.... during a render in Foo....
1. if Need to render secondary view then
begin
2. Bar = CreateBarClassSomehow();
3. Make Bar render itself;
4. Paste rendered Bar view into current view
end;
5. Render foo normally
I want to be able to create an ASPX file programmatically, but by doing so I
want the created ASPX file to execute as if it had been accessed directly
via a URL. The problem I am getting when creating the ASPX file manually,
is that if I access controls in Page_Load, they are null. But if I access
controls on a page that was loaded directly by the framework from a URL,
controls are not null during Page_Load.
Is there anyway to achieve this? I have considered making the Bar ASPX into
a Control, but I dont want to have to do that at this stage if possible.
Thanks for any advice or guidance with this problem.
Nick.
I have asked this question in a few guises recently, and not had much
response. But I dont think what I am asking is too obscure, so I am hoping
I just need to rephrase.
When a view is rendering itself (say Foo.aspx/Foo.aspx.cs), during rendering
it realises it needs a secondary view to do something (lets call it
Bar.aspx/Bar.aspx.cs). The logic is somehting like:
.... during a render in Foo....
1. if Need to render secondary view then
begin
2. Bar = CreateBarClassSomehow();
3. Make Bar render itself;
4. Paste rendered Bar view into current view
end;
5. Render foo normally
I want to be able to create an ASPX file programmatically, but by doing so I
want the created ASPX file to execute as if it had been accessed directly
via a URL. The problem I am getting when creating the ASPX file manually,
is that if I access controls in Page_Load, they are null. But if I access
controls on a page that was loaded directly by the framework from a URL,
controls are not null during Page_Load.
Is there anyway to achieve this? I have considered making the Bar ASPX into
a Control, but I dont want to have to do that at this stage if possible.
Thanks for any advice or guidance with this problem.
Nick.