ASP.NET AJAX页面的用户控件的方法 [英] ASP.NET AJAX Page Methods from UserControl

查看:163
本文介绍了ASP.NET AJAX页面的用户控件的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想利用ASP​​.NET AJAX页面方法的功能与用户的控制。有没有一种办法能够指定后面,而不是页面的$ C $后面Ç我的静态[WebMethod的]内的用户控件的code?

I would like to utilize the ASP.NET AJAX Page Methods functionality with a user control. Is there a way to be able to specify my static [WebMethod] inside the UserControl's code behind instead of the Page's code behind?

推荐答案

您也许不能。用户控件不具有页的所有功能,并且不能被直接调用。而应该创建一个web服务(ASMX)来处理这种情况。如果你想,web服务呼叫可以被路由到静态方法您的用户控件中。

You probably can't. The user control doesn't have all the functionality of a page and can't be called directly. You should instead create a webservice (asmx) to handle this scenario. If you wanted, the webservice call could be routed to the static method inside your user control.

这篇关于ASP.NET AJAX页面的用户控件的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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