开发者

Context.Items.Add on an XML return type?

So I have the following code contained within an HttpModule in an application I've been asked to support:

app.Context.Response.ContentType = "text/xml";
app.Context.Items.Add("IpixRoomId", ipixRoomId);
app.Context.Items.Add("IpixId", ipixId);
app.Context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
app.Context.RewritePath(rewriteUrl, true);

What's the purpose of adding data to Context.Items when the content type is XML?

E开发者_运维百科DIT: For clarification, I'm calling up this URL:

http://website.com/virtualtour/1971/6284/panorama2flash.swf

I assume the SWF file (I know very little about Flash) makes another call to http://website.com/virtualtour/config.xml. The code I pasted above only executes on calls to config.xml. So since it's only the SWF file and config.xml being requested from the server, I'm a little confused. Can the .SWF file have access to HttpContext.Current.Items?

Other than the HttpModule, there is no .NET involved in the code, it's a straight request to the SWF file which triggers a call to config.xml but it seems that those Context.Items contain the data needed to make the SWF file display the right virtual tour. I'm just missing where that link happens. It can't happen in the XML, so maybe in Flash?


HttpContext.Items is a temporary repository that lives for the span of the request, it is generally used in modules to share state within/with other modules and with the pipeline that is handling the request.

The main reason is exactly that, passing information back and forth.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜