Re: Create Pages on the fly using IHttpHandler. Need advice

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I was able to solve the problem by doing hooking into the constructor for Child.master...dunno if you'll have any side effects this way though...

public sub Child()
MasterPageFile = "Parent.master"
end sub

Pages, controls and masterpages are all class deep down...and if something fires BEFORE PreInit, the constructor must be it :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/


"shapper" <mdmoura@xxxxxxxxx> wrote in message news:1164815113.931430.309640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

Got it. I didn't know about the PageHandler part.

I was just looking for a way to solve a problem which I am fighting for
2 days:

How to set the following Nested Master Pages at runtime:

Parent.master
| ---- Child.master
| ------ Page.aspx

Yes, I know that in Page.aspx.vb I can do Me.MasterPageFile =
"~/_Child.master" on the PreInit event. However, I can't do the same on
Child.master.vb because I don't have a PreInit event there.

Do you know any article or have any code example which might help me
with this?

Thank You a Lot,
Miguel

Karl Seguin wrote:
I don't fully understand what you're trying to do...It seems like whatever
you are doing doesn't have an HTML/ASPX front-end component to it....

aspx files are handled by a built-in handler, called the PageHandler...it's
a relatively heavy process...it must raise a number of events (init, load,
prerender, unload are the most well known) as well as do a lot of postback
and viewstate manipulation.

If your requests aren't doing any of those, such as a RSS feed, then a
custom httphandler is typically the correct way to go. It's faster and it's
the right tool for the job.

On the flip side, you'll lose a lot of the framework laid out by the
PageHandler (which is quite a bit)..it's typically pretty obvious if you
need ASP.NET pages or not...

Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/


"shapper" <mdmoura@xxxxxxxxx> wrote in message
news:1164812752.815455.69330@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hello,
>
> In this moment I am creating all my aspx pages on my vb.code at
> runtime.
>
> It seems nonsense to have .aspx and .aspx.vb files in my projects.
>
> I am considering creating my pages on the fly using IHttpHandler.
>
> I already did that for delivering XML files.
>
> Could someone advice me on this?
>
> What are the ups and downs of doing this?
>
> Thanks,
>
> Miguel
>


.



Relevant Pages

  • Re: Sub class constructor
    ... If you want to use parent constructors when instanciating your child class, ... public sub New ... constructors not parent class constructor; ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Overloading a constructor/default constructor
    ... I was able to overload my default constructor. ... > Public Sub clsTest ... > Dim testCls As New clsTest ...
    (microsoft.public.dotnet.languages.vb)
  • Re: open form sending value?
    ... Public Sub New ... InitializeComponent() ... Public Class Form1 ... If you add a new constructor with a parameter make sure you create another with no parameter or you will loose the ability to edit the form in the designer. ...
    (microsoft.public.dotnet.languages.vb)
  • 2nd Constructor not working
    ... Too many arguments to 'Public Sub New'. ... does each class have to have its own constructor or can I use the same ... have a small object for each type of variable (string, integer, boolean, ... Private _first As Object ...
    (microsoft.public.dotnet.languages.vb)
  • Open a new browser window problem!!
    ... I have a aspx page on which I have a button. ... In the click event method ... Public Sub cmdSubject_ServerClick(ByVal sender As System.Object, ... and opening a new browser window ...
    (microsoft.public.dotnet.framework.aspnet)