开发者

ASP.net should render all it's scripts in separate files rather than in the page html

I know it's not really a question. But this is bothering me like hell. ASP.net adds so many inline scripts to my pages. Postback scripts, Ajax sc开发者_如何学编程ripts(many of them), Scroll position script, default button/field script, etc etc etc.

Why on earth would they not just include all this mess in several files. All ajax into its file, all postback and web forms stuff into its own and so on.

Is there some place where I can complain about this and/or make a suggestion to the MS developers?


ASP.NET web forms is not intended for developers to write actual HTML pages. You put controls on a page which emit HTML and any supporting resources (including scripts). The idea is that the developer should not really have to worry about the content of the page itself; as long as you use the right controls, everything should work automagically. In theory.

If you want complete control over the rendered page, consider using MVC instead. With MVC you write the markup itself and have the ability to use inline or unobtrusive techniques as you see fit.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜