Initialize not being called

Discussion in 'ASP .Net' started by bryan@newsgroups.nospam, Sep 16, 2005.

  1. Guest

    I'm using the UIP App block and I have overridden the Initialize
    method, but my override never gets called. Here's the code:

    public override void Initialize(TaskArgumentsHolder args,
    ViewSettings settings) {

    base.Initialize (args, settings);

    Logger.Write("Initialize");

    }

    Any ideas?

    Thanks,
    Bryan
     
    , Sep 16, 2005
    #1
    1. Advertisements

  2. Hi Bryan,

    We have reviewed this issue and are currently researching on it. We will
    update you ASAP. Thanks for your patience!

    Kevin Yu
    =======
    "This posting is provided "AS IS" with no warranties, and confers no
    rights."
     
    Kevin Yu [MSFT], Sep 17, 2005
    #2
    1. Advertisements

  3. Hi Bryan,



    Welcome to MSDN newsgroup!



    Based on my understanding, the current situation is you create a custom
    class to implement the IView interface and use the custom class in the
    project. Please let me know if I have misunderstood anything.

    As far as I know, the Initialize method is called after the view manager
    instantiates the view. So could you please help me to confirm some
    information?

    First, the category of the application is Winform or Web form;

    Second, please supply the code snippet of calling the Initialize method;

    Third, I suggest we set the breakpoint for the override function and debug
    the project. Then we can confirm whether the Initialize method executes or
    just add log failed.



    I look forward to your reply.



    Yuan Ren [MSFT]
    Microsoft Online Support
     
    ÈÎÔ¶[΢Èí], Sep 19, 2005
    #3
  4. Guest

    On Mon, 19 Sep 2005 06:30:34 GMT, ("ÈÎÔ¶[΢Èí]")
    wrote:

    Yuan -
    I create a class derived from WebFormView and override the
    Initialize method:

    public class ViewWelcome : WebFormView {


    public override void Initialize(TaskArgumentsHolder
    args, ViewSettings settings) {

    base.Initialize (args, settings);

    Logger.Write("Initialize");

    }
    ..
    ..
    ..
    }

    I never see the "Initialize" message in the log, and if I set a
    breakpoint in this method it never gets hit.

    I verified that the page does actually load by setting a breakpoint in
    the Page_Load method.

    Thanks for the help.
    Bryan

    >Hi Bryan,
    >
    >
    >
    >Welcome to MSDN newsgroup!
    >
    >
    >
    >Based on my understanding, the current situation is you create a custom
    >class to implement the IView interface and use the custom class in the
    >project. Please let me know if I have misunderstood anything.
    >
    >As far as I know, the Initialize method is called after the view manager
    >instantiates the view. So could you please help me to confirm some
    >information?
    >
    >First, the category of the application is Winform or Web form;
    >
    >Second, please supply the code snippet of calling the Initialize method;
    >
    >Third, I suggest we set the breakpoint for the override function and debug
    >the project. Then we can confirm whether the Initialize method executes or
    >just add log failed.
    >
    >
    >
    >I look forward to your reply.
    >
    >
    >
    >Yuan Ren [MSFT]
    >Microsoft Online Support
     
    , Sep 19, 2005
    #4
  5. Hi Bryan,

    Thanks for your posting!

    Based on my understanding, you require getting a custom attributed value
    while the application is loading. Meaning you want to use a ViewSettings
    argument such as ¡°ViewSettings.Type¡±. Please let me know if I have
    misunderstood.

    If we want to use the value in our custom class, I think reading the
    setting from the config file directly is a better way. In the ¡
    °WebFromViewManager.cs¡± file, the ¡°ActiveView¡± method is another method
    for getting the value of settings, but different from the ¡
    °WindowsFormViewManager.cs¡± file. The WebForm Application doesn¡¯t supply
    any method like ¡°Initialize¡±, so my suggestion is we read the value of
    the setting from the config file by using a XML reader or have the UIP do
    it. The reading method can be executed in our custom ¡°WebFormView_Load¡±
    method.

    I hope the above information helps, if you have any questions or concerns,
    please do not hesitate to let me know. I am standing by to help you.

    Yuan Ren [MSFT]
    Microsoft Online Support
     
    ÈÎÔ¶[΢Èí], Sep 21, 2005
    #5
  6. Guest

    Hi Yuan -
    I think you have understood my problem. I have several attributes
    which I want to associate with individual views. Since it looks like
    there is no easy way to have the UIAP block get these for me in a
    WebFormView derived class, I'll just read them from the config file
    myself as you suggested.

    Thanks,
    Bryan
     
    , Sep 21, 2005
    #6
  7. Hi Bryan,

    While, I'm glad to help you for the issue. If you have any issues or
    concern, welcome to MSDN newsgroup. We'll discuss together.

    Regards,

    Yuan Ren [MSFT]
    Microsoft Online Support
     
    ÈÎÔ¶[΢Èí], Sep 22, 2005
    #7
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. fadi
    Replies:
    2
    Views:
    685
  2. George Durzi

    ASCX - Function Not Being Called

    George Durzi, Jun 26, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    1,849
    George Durzi
    Jun 26, 2003
  3. Martin

    Session_OnEnd is not being called

    Martin, Dec 29, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    3,755
    Alvin Bruney
    Dec 30, 2003
  4. Sam
    Replies:
    2
    Views:
    4,700
  5. Edward Bills
    Replies:
    0
    Views:
    558
    Edward Bills
    Aug 25, 2004
  6. epigram

    ASPX page not always being "called"

    epigram, Aug 12, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    467
    Joerg Jooss
    Aug 17, 2005
  7. Felix
    Replies:
    1
    Views:
    514
    Felix
    Sep 29, 2006
  8. Oliver Saunders
    Replies:
    5
    Views:
    283
    Robert Klemme
    May 27, 2009
Loading...