Front Controller working version

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt

    Front Controller working version

    Can someone please provide me working version of front controller
    framework so i can start project.

    Any link would be great. the one on microsoft site is complecated

  • Matt

    #2
    Re: Front Controller working version

    Can some pls tell me how can i pass the url on base page the handle
    what is the syntax.
    aspx page
    public class Main : Handler.BasePag e
    {

    protected override void PageLoadEvent(o bject sender, System.EventArg s
    e)
    {

    }
    }

    MyBase class

    public class BasePage : Page
    {
    virtual protected void PageLoadEvent(o bject sender, System.EventArg s
    e)
    {}
    protected void Page_Load(objec t sender, System.EventArg s e)
    {
    if(!IsPostBack)
    {
    what is the sysntax
    PageLoadEvent(s ender, e);
    }
    }
    }

    handler class
    public void ProcessRequest( HttpContext context)
    {
    handler.Process Request(context );
    }

    Comment

    • Matt Berther

      #3
      Re: Front Controller working version

      Hello Matt,

      Do you mean Request.Url?

      You can access that in your derived class without passing it because of the
      wonders of inheritance. :)

      --
      Matt Berther

      [color=blue]
      > Can some pls tell me how can i pass the url on base page the handle
      > what is the syntax.
      > aspx page
      > public class Main : Handler.BasePag e
      > {
      > protected override void PageLoadEvent(o bject sender,
      > System.EventArg s
      > e)
      > {
      > }
      > }
      > MyBase class
      >
      > public class BasePage : Page
      > {
      > virtual protected void PageLoadEvent(o bject sender, System.EventArg s
      > e)
      > {}
      > protected void Page_Load(objec t sender, System.EventArg s e)
      > {
      > if(!IsPostBack)
      > {
      > what is the sysntax
      > PageLoadEvent(s ender, e);
      > }
      > }
      > }
      > handler class
      > public void ProcessRequest( HttpContext context)
      > {
      > handler.Process Request(context );
      > }[/color]



      Comment

      • Matt

        #4
        Re: Front Controller working version

        Thanks matt
        But I am not sure
        On Aspx.cs file i inherit BasePage CS to handel Page_Load and when
        page_load executes, just would like to ref handler to find out the url.
        so i have to do something in basepage.cs to get handler to get me the
        page

        just want to find out what i am suppose to write in basePage void
        page_load method.
        handler.Process Request(context ­); works fine. i just have to give this
        guy or pass him the page that i want i think.

        thanks

        Comment

        • Matt Berther

          #5
          Re: Front Controller working version

          Hello Matt,

          Implementing Front Controller can be quite difficult with just a q/a session.
          The patterns and practices group has an article [1] that talks about this.
          Why dont you review this and see if it helps with some of these questions.
          Once you've reviewed that and tried the suggestions in there, if you're still
          stuck, let me know. Id be glad to help you from there.

          [1] http://msdn.microsoft.com/library/de...ollerInASP.asp

          --
          Matt Berther

          [color=blue]
          > Thanks mattBut I am not sureOn Aspx.cs file i inherit BasePage CS to
          > handel Page Load and whenpage load executes, just would like to ref
          > handler to find out the url.so i have to do something in basepage.cs
          > to get handler to get me thepagejust want to find out what i am
          > suppose to write in basePage voidpage load method.
          > handler.Process Request(context ­); works fine. i just have to give this
          > guy or pass him the page that i want i think.thanks
          >[/color]



          Comment

          Working...