开发者

how to Request a resource without requesting a webPage in Asp.Net Application?

We have a Web Application (WebApplication A) which is in place and serving fine, we are working on another WebApplication which will use the Engine of Existing Web Application (WebApplication B) to some extent.

Problem: WebApplication A responds when a http request is made for开发者_如何学JAVA a resource, like LatestPost.aspx, which passes it down to relevant class / Module like FrontManager.cs. I want to know how can we access that Module / class (FrontManager.cs) from WebApplication B, without requesting a Web Page ?


Use an HttpHandler. You will need to create a class which implements IHttpHandler and register it in the <httphandlers> section of the web.config file. These are commonly accessed with a .ashx extension (LatestPost.ashx in your case).


Create a web service, using WCF, to expose the operations of FrontManager.cs.

However, you should try to separate the user-interface aspects of FrontManager.cs from the actual functionality. Expose the raw functionality, with no reference back to user-interface.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜