xml and hyperlinks within context

Discussion in 'ASP .Net' started by Jimbo, Nov 10, 2005.

  1. Jimbo

    Jimbo Guest

    Hey

    Have a real problem here.

    I have a page that consists of a lot of div tags and everything on the
    page is made in controls.

    In one of the controls we call a method in another class that produces
    some XML, In the end of that method we call transform to render the xml
    ive built up in .net into HTML from the xsl stylesheet. The output is
    rendered to the users browser.

    So far this is a pretty standard way to produce i page i think. A
    control calling a class, producing XML and transforming the XML into
    HTML using a XSL stylesheet.

    What i want to do is building a tree structure out of the information
    in XML, and for this i put a hyperlink on every "+" or "-" sign. This
    hyperlink links to the same page, but for some reason, when i come back
    to that page all my Context.Items are gone!

    Why?

    Hope you can help.


    Jimmy
    Jimbo, Nov 10, 2005
    #1
    1. Advertising

  2. Jimbo

    Brock Allen Guest

    HttpContext.Items is a per-request property bag. Once the page is rendered
    and sent back to the client The HttpContext and its Items are gone. A new
    request (or a postback) creates a new instance of the HttpContext, Request,
    Response, Items and other objects. What are you trying to do with the HttpContext.Items?

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen

    > Hey
    >
    > Have a real problem here.
    >
    > I have a page that consists of a lot of div tags and everything on the
    > page is made in controls.
    >
    > In one of the controls we call a method in another class that produces
    > some XML, In the end of that method we call transform to render the
    > xml ive built up in .net into HTML from the xsl stylesheet. The output
    > is rendered to the users browser.
    >
    > So far this is a pretty standard way to produce i page i think. A
    > control calling a class, producing XML and transforming the XML into
    > HTML using a XSL stylesheet.
    >
    > What i want to do is building a tree structure out of the information
    > in XML, and for this i put a hyperlink on every "+" or "-" sign. This
    > hyperlink links to the same page, but for some reason, when i come
    > back to that page all my Context.Items are gone!
    >
    > Why?
    >
    > Hope you can help.
    >
    > Jimmy
    >
    Brock Allen, Nov 10, 2005
    #2
    1. Advertising

  3. Jimbo

    Jimbo Guest

    Ah i see.

    Think my problem is that i thought it would stay put in the context
    items no matter how many postback/requests i made. Guess i was wrong.

    Im building a HTML page through an XML styelsheet. This HTML is
    displayed to the user. Its actually a tree structure, so the user can
    press + or - to expand, or the reverse, each line of text. Much like in
    Windows explorer. I just have to keep track on wich + were pressed and
    reload the values like userid and that sort of stuff so the page can be
    rendered properly again.

    Guess i just have to refill the context.items and my problem will be
    solved.

    Also i can see that viewstate is used. Like viewstate[Userid]. Isnt
    that permanent values or is the viewstate deleted as well on every
    request/postback to the page?

    Thanks :)


    Jimmy
    Jimbo, Nov 17, 2005
    #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. Paul
    Replies:
    1
    Views:
    399
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 8, 2004
  2. VadimGor
    Replies:
    8
    Views:
    7,548
    ByteCoder
    May 22, 2005
  3. Ultrus
    Replies:
    3
    Views:
    364
    Stefan Behnel
    Jul 9, 2007
  4. -Lost
    Replies:
    7
    Views:
    172
    -Lost
    Mar 24, 2007
  5. Norah Jones
    Replies:
    0
    Views:
    67
    Norah Jones
    Apr 7, 2014
Loading...

Share This Page