search
Japanese Chinese Nederlands Espanol Italiano Deutsch Francais Twitter Rss Feeds
.NET Framework GroupsView
Deployment Server
.NET Distributed_Apps
.NET
.NET ADO.NET
.NET ASP.NET
.NET ASP.NET Security
.NET ASP.NET Webcontrols
.NET ASP.NET Web Services
.NET Clr
.NET Compact Framework
.NET Drawing
.NET Interop
.NET Micro Porting
.NET Performance
.NET Web Services
.NET Windows Forms
.NET Windows Forms Controls
.NET General
.NET Csharp
.NET Visual Basic
.NET Vc
.NET Security
.NET Xml
Scripting Jscript
Scripting Visual Basicscript
Scripting Wsh
Smartphone Developer
Visual Basic Com
Visual Basic Controls
Visual Basic Crystal
Visual Basic Database Ado
Visual Basic Syntax
Visual Basic Vista Compatibility
Visual Basic Winapi
Vc Atl
Vc Debugger
Vc Language
Vc Mfc
Vc Stl
Visio Developer Visual Basica
Vsnet Debugging
Windows Powershell
Windowsce Embedded Vc
Xml
Xsl

Group SummariesView
.NET Framework
Access
BizTalk
Certifications
CRM
DDK
Exchange Server
FoxPro
French
French .NET
Games
German
German .NET
Graphic Design
IIS
Internet
ISA Server
Italian
Italian .NET
Maps
MCIS
Miscellaneous
Mobile Application Development
Money
MSN
Networking
Office
Ops Mgr
Publisher
Security
SharePoint
Small Business
Spanish
Spanish .NET
SQL Server
Systems Management Server
Transaction Server
Virtual PC / Virtual Server
Visual Studio
Win32
Windows 2000
Windows 2003 Server
Windows 7
Windows Live
Windows Media
Windows Update
Windows Vista
Windows XP
 

View All Microsoft NET Csharp Posts  Ask A New Question 

Using HttpListener to host ASP.NET web application - Hans-Jürgen Philippi

Thursday, December 13, 2007 5:20 AM

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
reply
 

Hans, When you use the HttpListener, all it does is provide an interface - Nicholas Paldino [.NET/C# MVP]

Thursday, December 13, 2007 10:13 AM

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
reply

Suggest that you take a look at the "Cassini" managed web server code. - pbromber

Thursday, December 13, 2007 1:33 PM

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
reply

Hi Nicholas,I guess I should have mentioned more explicitely that the - Hans-Jürgen Philippi

Friday, December 14, 2007 8:54 AM

Hi Nicholas,



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.


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
reply

Previous Microsoft NET Csharp conversation.