xml and hyperlinks within context

J

Jimbo

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
 
B

Brock Allen

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?
 
J

Jimbo

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top