【发布时间】:2013-06-26 19:49:07
【问题描述】:
我有调用 wcf 服务的自定义 httphandler。按服务返回Stream
[OperationContract]
Stream GetMyStream(int width, int height);
我正在从图像标签调用我的 aspx 页面中的 http 处理程序:
<asp:Image ID="imgStream" runat="server" ImageUrl="MyStreamHandler.ashx" Visible="true" />
在我的处理程序中,我引用了 WCF 服务,我正在调用如下操作:
MyServiceClient tcpClient = new MyServiceClient();
Image img = Image.FromStream(tcpClient.GetMyStream(30,100));
我在我的服务中使用 NetTcp 绑定。现在,我可以通过 jquery ajax 调用我的 aspx 页面中的 http 处理程序,并在图像标签中显示流,以避免在页面上回发。
谢谢。
【问题讨论】:
标签: c# asp.net wcf jquery httphandler