帮助我了解网络方法吗? [英] Help me understand web methods?

查看:82
本文介绍了帮助我了解网络方法吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个用webmethod和scriptmethod标记标记的页面上有一个方法.

I have a method on a page marked with the webmethod and scriptmethod tags..

该方法将对象的集合作为JSON数据返回给jquery函数,没有麻烦,而且无需我手动对其进行序列化.

The method returns a collection of objects to a jquery function as JSON data with no hassles and without me having to manually serialize it.

我现在正尝试使用HTTPHandler重新创建相同的方法,并且想知道为什么现在必须手动序列化数据.

I am now trying to recreate that same method using a HTTPHandler and was wondering why i have to now manually serialize the data.

什么使网络方法与众不同?

What makes the webmethod different?

推荐答案

由于HTTP处理程序(种类繁多)位于ASP WebForms堆栈上方,因此您将完全负责处理程序的工作和输出.

Because an HTTP handler (kind of) sits above the ASP WebForms Stack, you are totally responsible for the workings and output of the handler.

您可以(几乎)利用任何可以在.NET框架中使用的东西,但是可以肯定的是,HTTPHandler比ASP.NET提供的现成解决方案要更有效.

You can utilise (almost) anything you can get your hands on within the .NET framework, but for sure, an HTTPHandler will be more work than an off-the-shelf solution provided by ASP.NET.

ASP.NET页面处理程序只是一个 处理程序的类型. ASP.NET附带 其他几个内置处理程序,例如 作为.asmx的Web服务处理程序 文件.

The ASP.NET page handler is only one type of handler. ASP.NET comes with several other built-in handlers such as the Web service handler for .asmx files.

您可以创建自定义HTTP处理程序 当您想要特殊处理时 您可以使用文件名进行识别 您的应用程序中的扩展程序

You can create custom HTTP handlers when you want special handling that you can identify using file name extensions in your application

请参见 http://msdn.microsoft.com/en-us/library/ms227675(VS.85).aspx

这篇关于帮助我了解网络方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆