Response.Write vs <%= %>

后端 未结 15 2683
我在风中等你
我在风中等你 2020-12-28 14:34

Bearing in mind this is for classic asp

Which is better, all HTML contained within Response.Write Statements or inserting variables into HTML via &l

15条回答
  •  不思量自难忘°
    2020-12-28 15:08

    I agree with Jason, more so now that .NET is offering an MVC framework as an alternative to that awful Web Form/Postback/ViewState .NET started out with.

    Maybe it's because I was old-school classic ASP/HTML/JavaScript and not a VB desktop application programmer that caused me to just not grokk "The Way of the Web Form?" but I'm so pleased we seem to be going full circle and back to a methodology like Jason refers to.

    With that in mind, I'd always choose an included page containing your model/logic and <%= %> tokens within your, effectively template HTML "view." Your HTML will be more "readable" and your logic separated as much as classic ASP allows; you're killing a couple of birds with that stone.

提交回复
热议问题