Using HttpListener to host ASP.NET web application

  • Thread starter Hans-Jürgen Philippi
  • Start date
H

Hans-Jürgen Philippi

Hi Group,

I've created a (very simple) ASP.NET web application with a single *.aspx
page and an *.aspx.cs CodeBehind file: By clicking an HTML form button, a
text control value is written into a label below using a click handler and a
server roundtrip.
Pretty nifty, I know...

Now I want to run this app hosted by an own web server, an HttpListener
based C# application I've created with Visual Studio 2005 - what doesn't
work. The *.aspx page gets published but obviously the actual server
operation/click handler is not executed, the label stays blank and after the
server roundtrip the text control is empty again, no session seems to be
managed although the corresponding hidden form values are there.

Any idea what may be different when the web application runs fine with the
ASP.NET development server launched by Visual Studio? What to look for to
have a web application hosted by an own HttpListener based approach?

Thanks in advance + greetings,
Hans
 
H

Hans-Jürgen Philippi

Hi Nicholas,

When you use the HttpListener, all it does is provide an interface for
HTTP clients to connect to. It does NONE of the underlying work to
actually process the page.

I guess I should have mentioned more explicitely that the application I've
created actually does involve the CreateApplicationHost() method and thereby
the ASP.NET runtime. As I've said before: The hidden HTML form session
variables are created, but nevertheless the most simple page functionality
is not executed.

You can actually host the ASP.NET runtime in your own app. Here is an
article which explains how to do it:
http://www.microsoft.com/belux/msdn/nl/community/columns/desmet/hostaspnet1.mspxI'll see if this article points me to something I may have forgotten.Thanks anyway,Hans
 

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

Top