使用ASP.NET Web API处理HTML控件

问题描述:

Hello world,



我正在开发一个新项目,将旧的ASP.NET Web表单与AjaxPro和YUI 1.0应用程序转换为使用jQuery和Web的纯Html API。但是,我想对我的问题有一个答案,因为我没有使用Web API的经验。



在旧的Web应用程序中,我们正在处理来自代码的Web控件因此,如果您需要处理文本框控件,请检查用户已设置和显示/隐藏的选项,提供默认值或绑定默认选项。如果我删除后面的代码以删除回发并将代码移动到Web API,那么除非通过jQuery ajax调用从Web API检查选项,否则无法处理文本框。有些屏幕可能有很多控件要以相同的方式处理,我必须使用大量的Ajax调用来控制它们。这是一种正确的方法吗?



任何想法都将受到赞赏。

Hello world,

I am working on a new project that convert old ASP.NET web form with AjaxPro and YUI 1.0 application to plain Html with jQuery and Web API. However, I want to have an answer about my question since I have no experience with Web API.

In the old web application, we are handling web controls from code behind so if you need to handle a Textbox control then check the option that user already set up and show/hide , give default value, or binding default options. If I remove code behind to remove post back and move the code to web API then there is no way to handle the Textbox unless check the option from Web API via jQuery ajax call. Some screens could have a lot of controls to be handled with the same way and I have to use a lot of Ajax call to control them. Is this a proper approach?

Any ideas will be appreciated.