How can I take more control in ASP.NET?

前端 未结 7 654
感情败类
感情败类 2020-12-22 16:25

I\'m trying to build a very, very simple \"micro-webapp\" which I suspect will be of interest to a few Stack Overflow\'rs if I ever get it done. I\'m hosting it on my C# in

7条回答
  •  庸人自扰
    2020-12-22 16:54

    I thought the asp:Repeater control was obsolete.

    The ASP.NET template engine is nice but you can just as easily accomplish repeating with a for loop...

    <% foreach( var item in dataSource ) { %>
    Some text
    <% } %>

    ASP.NET Forms is sort of okay, there's decent support from Visual Studio but this runat="server" thing, that's just wrong. ViewState to.

    I suggest you take a look at what makes ASP.NET MVC so great, who it moves away from the ASP.NET Forms approach without throwing it all away.

    You can even write your own build provider stuff to compile custom views like NHaml. I think you should look here for more control and simply relying on the ASP.NET runtime for wrapping HTTP and as a CLR hosting environment. If you run integrated mode then you'll be able to manipulate the HTTP request/response as well.

提交回复
热议问题