MSDOTnet.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using HttpListener to host ASP.NET web application

 
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp
Author Message
Hans-Jürgen Philippi



Joined: 11 Aug 2007
Posts: 2

PostPosted: Thu Dec 13, 2007 4:20 pm    Post subject: Using HttpListener to host ASP.NET web application Reply with quote

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

Archived from group: microsoft>public>dotnet>languages>csharp
Back to top
View user's profile Send private message
Nicholas Paldino [.NET/C#



Joined: 08 Aug 2007
Posts: 71

PostPosted: Thu Dec 13, 2007 3:13 pm    Post subject: Re: Using HttpListener to host ASP.NET web application Reply with quote

Hans,

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.

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.mspx


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

"Hans-Jürgen Philippi" wrote in message @TK2MSFTNGP06.phx.gbl...
> 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
>
Back to top
View user's profile Send private message
Peter Bromberg [C# MVP]



Joined: 31 Oct 2007
Posts: 22

PostPosted: Thu Dec 13, 2007 3:33 pm    Post subject: RE: Using HttpListener to host ASP.NET web application Reply with quote

Suggest that you take a look at the "Cassini" managed web server code. There
are several versions that people have enhanced. Search and you will find.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com


"Hans-Jürgen Philippi" wrote:

> 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
>
>
>
Back to top
View user's profile Send private message
Hans-Jürgen Philippi



Joined: 11 Aug 2007
Posts: 2

PostPosted: Fri Dec 14, 2007 7:54 pm    Post subject: Re: Using HttpListener to host ASP.NET web application Reply with quote

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

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
host ... In my App the user could manually enter some host computer location for this he has the choice to enter either the IP or host name. I get the IP address internally with the following code sample: IPAddress ia; try { ia = } catch(For

host server doesn't shutdown I've a simple server program that hosts remoting objects (singlecall). The main sub load remoting configuration and then: to terminate") The program works fine. It loads remoting object, and they works.

Creating your own CLR host question We have run into an issue with the garbage collection routine in the mscorwks.dll which was chosen by the CLR. We would like to use the mscorsvr.dll but in order to do so without resorting to an unsupported setting we must cretate our own CLR host. Well

Designer Host Container Hi, how can I find those components which I have to add to the designer host container? Thanks, Bernd

code serialize and designer host hello, can you help please? i implemented a designer program ( a mini VisStudio, haha) . i can now place controls from a toolbox on a form. now i want to create the c# source code for the of that form. how can i do that? i understand abou
Post new topic   Reply to topic    MSDOTnet.org Forum Index -> C Sharp All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group