开发者

Are there alternatives to ASP.NET for C# web development?

Lately, I've been thinking that I'd like to try some new ideas and a new approach to web application design. I'm mostly used to using ASP.NET (.NET 2.0) 开发者_开发问答but I've toyed with the ASP.NET MVC library a little bit as well. While both are powerful and interesting, I'd really like something more... basic.

Is there anything like that out there? I'd like a framework that's more transparent really: I want to be able to see the request, pass it where I want, render HTML the way I want, and post requests how I want. I can get all that in ASP.NET, but I have to dig pretty hard to get at all of it. I'd like something simpler to use as the basis for some new framework ideas.

So is there something like that out there? Or would I pretty much have to completely reinvent all the basic routing, request, and response code as well to get a platform to build up from?


I'm not sure if it fits your requirements, but you could definitely check out Manos


It's not answering the question but I really strongly think you're making a mistake here.

MVC lets you deal with rendering in the way you want (it's not like the bad old webforms), HttpHandlers let you deal with Requests and Responses as low down as makes reasonable sense (to me). 99 times out of 100 you don't want to have to deal with the raw raw data coming from the web server (and what is raw anyway? "Request" is an abstraction itself...).

I think you have to look long and hard at your motivation and consider the practical costs if you could get there.


You should look at Fubu MVC then FubuMVC


I would say if you are set on C# as your language ASP.net MVC is as good as it gets right now. You may want to experiment with other template engines like Spark or Nhamle.


I would go and implement an HTTP handler using ASHX files. It gives all the power of ASP.NET object model but do not limit you on any special way of handling the request.


If you are looking for alternate frameworks you might want to have a look at Nina

https://github.com/jondot/nina

From the website:

Nina is a web microframework for the .Net platform, inspired by Sinatra. It includes several aspects that go futher beyond Sinatra, such as an abstract, pluggable, and extensible infrastructure.

  • A simple to use DSL, a simple programming model.
  • Performance as a goal.
  • Multiple pluggable view engines.
  • Many scenarios covered by Json and XML serialization support.
  • Advanced cache-control for a RESTful ecosystem; automatic ETagging and Last-Modified controls.
  • Nina is intentionally build against the .Net 2.0 runtime in order to afford a lower barrier of entry!. A port of Nina for the 4.0 runtime will be available shortly.
  • Razor support note: I chose to use RazorEngine, which is an open-source abstraction of a Razor view engine without using the full MVC stack. In that implementation, view data is exposed as 'Model'. I chose to align other views and now each view has its view data accessible by 'Model' and 'ViewData' members (except Razor).


I think you want the WebMatrix.

It's basicly a very simple (ASP like) model, but then coded with C# / .Net, and you get the @Razor syntax.


Although this is a relatively old question, I would like to add some other frameworks that are worth a look:

  • MonoRail is older than Asp.NET MVC and very similar to it. They are currently working on Version 3 of MonoRail. I used MonoRail Version 2 for a side project and it was a nice experience.
  • OpenRasta. I have no experience with this right now.
  • TinyWeb. An excellent Asp.NET Micro Framework (You may find the comparison of .NET Microframeworks interesting (including the Anna and Jessica web frameworks))


There is the ASP.net Model View Presenter which may be something like what you are looking for.

http://www.codeproject.com/KB/architecture/ModelViewPresenter.aspx


It sounds to me like you're looking for a microframework like Sinatra , but in c# instead of Ruby. I am not aware of any such framework.

I recommend you dive into Sinatra itself. Learning Ruby will help expand you as a developer, you'll be closer to the HTTP metal (which sounds like what you want), and it'll be fun. The minimalism and simplicity that it sounds like you're looking for is much more popular in the Ruby community.


If you can use mono. Then you can try Mongrel2 with dot net bindings. It is very fast language agnostic web server. It works via zeroMQ.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜