ASP.NET MVC AjaxHelper 是否处理降级?
有谁知道ASP.NET MVC框架中的AjaxHelper是否处理降级?
例如,如果您有一个更新 div 内容的 ActionLink,如果 JavaScript 不可用,页面是否会通过 renderubg 页面(通过控制器上的操作)进行完整回发并调用 ActionLink 中指定的操作?
如果没有,您建议如何为启用了 JavaScript 的浏览器以及在 MVC 应用程序上下文中禁用 JavaScript 的浏览器正确创建页面功能?
Does anyone know if the AjaxHelper in the ASP.NET MVC framework deals with degradation?
For example, if you have an ActionLink that updates the content of a div, if JavaScript unavailable, will the page do a full postback by renderubg the page (via an action on a controller) and call the action specified in the ActionLink?
If not, how would you suggest making a page function correctly for browsers with JavaScript enabled and those who have it disabled within the context of an MVC app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试的一件事是在控制器中重写 OnActionExecuted 方法并更改不支持 JavaScript 的浏览器的 filerContext.ActionResult 。 您还可以将自己的 ActionFilter 添加到控制器中的不同操作中。
One thing you could try is in your controller, override the OnActionExecuted method and change the filerContext.ActionResult for non-JavaScript enabled browsers. You can also add you own ActionFilters to different actions in the controller.
您可以为
Ajax.ActionLink
调用的AjaxOptions
对象指定Url
参数:You can specify an
Url
parameter to theAjaxOptions
object to theAjax.ActionLink
call: