ASP.NET pages compile & run

Discussion in 'ASP .Net' started by andreister@gmail.com, Mar 9, 2006.

  1. Guest

    Hi skilled,

    I wonder if anybody knows how the ASP.NET actually does this.
    So far I have been assuming the following:
    1. aspx pages are compiled in gory-named files (ken0-m7f.0.jsl or
    something) under my "Temporary ASP.NET Files" folder.

    2. these files contain classes that extend my code-behind ones and
    implement System.Web.SessionState.IRequiresSessionState interface in
    order to deal with session variables.

    3. if I have a read/write property in a custom user control (ahem, I
    have a custom control extending System.Web.UI.UserControl),
    and if somewhere in my aspx page I have the initialization code

    <custom:tag runat="server" foo="zzzz">

    so consequently somewhere in this awkward ken0-m7f.0.jsl I would
    come across something like

    #line 44 "D:\\path\\to\\project\\hithere.aspx"
    __ctrl.set_foo("zzzz");

    4. It's all OK so far, but when I want the variable to be an object
    (for sure changes the type in code) and state

    <custom:tag runat="server" foo='<%# new String("ffff") %>'>

    5. the set-foo-lines in ken0-m7f.0.jsl are changed to

    #line 44 "D:\\path\\to\\project\\hithere.aspx"
    __ctrl.add_DataBinding( new
    System.EventHandler(this.__DataBind__control8) );


    Hummm... I could swear to the appropriate event handler is added to the
    control handler list but WHAT should I do to invoke/catch this
    delegate?
    Maybe a point where to dig through?

    Thank you,
    Andrew
    , Mar 9, 2006
    #1
    1. Advertising

  2. Guest

    Well... overcome this!
    In my custom control I've overloaded two methods:


    public Control get_BindingContainer() {
    Control container = get_Parent();
    try{
    //put in try-catch because at first time container is NULL
    //though FWIW feel like doing something illegal
    container = super.get_BindingContainer();
    }
    catch(Exception ex) {
    String s = ex.getMessage();
    s += "\nI am not scared, huh";
    }
    return container;
    }

    public void add_DataBinding(System.EventHandler value) {
    super.add_DataBinding(value);

    // uh oh, this is the magic line:
    super.DataBind();
    }

    and now I can pass object variables from aspx pages

    <custom:tag runat="server" foo="<%# new Integer(123) %>">


    That's okay, but could anybody explain what actually is happening
    behind the scene??
    Is there a better the way than I've proposed?

    Tia and kind regards,
    Andrew
    , Mar 9, 2006
    #2
    1. Advertising

  3. Guest

    , Mar 10, 2006
    #3
    1. Advertising

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. Shailesh Humbad

    asp.net to compile asp 3.0 pages

    Shailesh Humbad, Aug 29, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    366
    Shailesh Humbad
    Aug 29, 2003
  2. Manish
    Replies:
    1
    Views:
    633
    Steve C. Orr [MVP, MCSD]
    Nov 17, 2003
  3. Quentin Huo
    Replies:
    1
    Views:
    333
    M. Posseth
    Jun 15, 2004
  4. Nagaraj
    Replies:
    1
    Views:
    838
    Lionel B
    Mar 1, 2007
  5. Juan T. Llibre
    Replies:
    6
    Views:
    464
    Juan T. Llibre
    Apr 20, 2007
Loading...

Share This Page