Hosting ASP.Net runtime in Winforms app to display asp.net pages from memory stream

I'm currently trying to build an application which uses a webbrowser control to display formatted data. The pages I am trying to display might not be found on the harddrive of the local machine: they may be on a server or in a compressed file somewhere. To handle simple html requests I have created an asynchronous pluggable protocol to handle any requests and supply the pages from wherever they might be stored.

What I'm trying to do however is display ASP.Net pages. I don't have a web server to use to serve these file so I have to use the winforms application to host the asp.net runtime. I'm managed to implement that and have been able to display asp.net pages in the webbrowser control on the winforms app but the only way i've been able to do this is by having the actual web application structure recreated on the local machine.

I need to be able host the web site files in various different places, possibly compressed so I need to pass a fake domain url to the asp.net runtime when creating the application domain and then pass a memory stream or something when processing the files rather than a relative path.

I was wondering if anyone had any ideas on how to achieve this.


Answer this question

Hosting ASP.Net runtime in Winforms app to display asp.net pages from memory stream

  • CBuilder

    If you're already serving asp pages, it's an implementation detail on your end where the data is stored. Either you map the requested URL to a file, or you use to find the data somewhere else: database, in-memory collection, wherever.

  • Belliez

    according me you need to deploy Cassini Web Server (Personal Web Server that comes with VS 2005 ) with your windows application. in this way you will be able to server asp.net pages

     

    hope this helps



  • wilsone8

    Unfortunately not. The problem is not actually serving up the pages.

    I've got the application already serving up asp.net pages without the need of iis or cassini. My problem is that i the aspx files are not going to be on the local disk. In fact they may not be in a "file" form at all.

    I need a way of passing a memory stream rather than a file name to the asp.net runtime for processing. All I want to use the runtime for is as a pure rendering engine. I won't have a file structure / website for cassini or the asp.net runtime to point too. I just want to pass in an asp.net page memory stream and get back a memory stream which has the html formatted output.

    So unfortunately cassini or any either of the webservices articles were any help.

  • windperson

  • Hosting ASP.Net runtime in Winforms app to display asp.net pages from memory stream