简体   繁体   English

没有javascript的ASP.NET webforms

[英]ASP.NET webforms without javascript

Due to a security requirement all browsers that will run a web application we need to create must have all client side scripting disabled. 由于安全性要求,我们需要创建的所有运行Web应用程序的浏览器都必须禁用所有客户端脚本。 So that means no Javascript. 所以这意味着没有Javascript。 Unfortunately Web Forms make quite some use of Javascript. 不幸的是,Web Forms对Javascript的使用相当多。 The login control works without Javascript, but a button does not (it calls the Javascript function __doPostback()). 登录控件不使用Javascript,但按钮不起作用(它调用Javascript函数__doPostback())。 So to make it work we'd need to program all the forms by hand (the ASP Classic, or PHP method). 因此,要使其工作,我们需要手动编程所有表单(ASP Classic或PHP方法)。 But I was wondering if there is a framework available for ASP.NET that offers the normal ASP.NET controls (treeview, gridview, etc) with all the functoinality they have, but that doesn't use Javascript and doesn't require the programmer to program massive amounts of logic? 但我想知道是否有一个可用于ASP.NET的框架,它提供了具有所有功能的普通ASP.NET控件(treeview,gridview等),但是它不使用Javascript并且不需要程序员编写大量逻辑?

Update: For clarification, I know ASP.NET MVC is an option that will help a bit, but it won't give me a nice GridView. 更新:为了澄清,我知道ASP.NET MVC是一个有用的选项,但它不会给我一个很好的GridView。 So I'm wondering if there is a 100% functional, 100% no-javascript replacement for the standard ASP.NET controls. 所以我想知道是否有100%功能,100%无javascript替代标准ASP.NET控件。

Thanks. 谢谢。

Update2: It's been a while and I never found the exact answer I was looking for. Update2:已经有一段时间了,我从来没有找到我想要的确切答案。 Probably because what I want doesn't exist. 可能因为我想要的东西不存在。 So I'll go for ASP.NET MVC which is the next best thing. 所以我会选择ASP.NET MVC,这是下一个最好的事情。

ASP.Net MVC is probally the closest you'd get. ASP.Net MVC可能是你最接近的。 You can use it to build a site without javascript. 您可以使用它来构建没有JavaScript的网站。 It is very different from Web forms 它与Web表单非常不同

Many of the stock controls will be problematic. 许多库存控制都存在问题。 They just depend too heavily on Javascript. 他们过分依赖Javascript。 You do have some options, though: 不过你确实有一些选择:

  • ASP.Net MVC should give you a bit more control over your html ASP.Net MVC应该可以让你对你的html有更多的控制权
  • You can build your own replacement WebForms control library that doesn't rely on javascript to provide alternatives for controls that do. 您可以构建自己的替代WebForms控件库,该库不依赖于javascript来为控件提供替代方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM