Objectmix
Tags Register Mark Forums Read

Using HttpListener to host ASP.NET web application : CSharp

This is a discussion on Using HttpListener to host ASP.NET web application within the CSharp forums in Programming Languages category; 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 ...


Object Mix > Programming Languages > CSharp > Using HttpListener to host ASP.NET web application

Reply

 

LinkBack Thread Tools
  #1  
Old 12-13-2007, 05:20 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Using HttpListener to host ASP.NET web application

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


  #2  
Old 12-13-2007, 10:13 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Using HttpListener to host ASP.NET web application

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


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

"Hans-Jürgen Philippi" <HJPhilippi@aol.com> wrote in message
news:eqlaNHXPIHA.4272@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
>


  #3  
Old 12-13-2007, 01:33 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default RE: Using HttpListener to host ASP.NET web application

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

  #4  
Old 12-14-2007, 08:54 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: Using HttpListener to host ASP.NET web application

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/...1.mspxI&#39;ll see if this article points me to something I may have forgotten.Thanks anyway,Hans

Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
Using HttpListener to host ASP.NET web application usenet DOTNET 0 12-10-2007 12:12 PM
Where to host a Seaside application? usenet Smalltalk 2 10-03-2007 02:58 AM
Host .NET user controls in my C++ application usenet DOTNET 1 05-21-2007 07:06 AM
How to host web service methods in your windows application? usenet DOTNET 3 02-05-2007 06:46 AM
Host a secure web application and OWA, use as many servers and resources as necessary. usenet Inetserver 5 05-10-2006 01:41 PM


All times are GMT -5. The time now is 08:49 AM.

Managed by Infnx Pvt Ltd.