开发者

Can we call method that exist on aspx page through web service

Can 开发者_运维知识库we call a Method that exist on a aspx page through Web Services.

It is like Reflection that method exists in dll form , but is it possible to call method from Aspx page if yes then please tell me how is it?:confused:


The code-behind class in an ASPX page is just a class, so technically there is nothing stopping you from doing that. However, it strikes me as a really bad idea from code design point of view.

The code in an ASPX page class should be related only to that page. If you need the same functionality elsewhere, move the code for that functionality to some other place (such as a class library that can be called from both places).


You should extract common functionality to a class of its own - this way you can call the code from both the web page and the web service and keep them decoupled from each other.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜