关于wcf和页面导航的设计问题
我有 ac#/asp.net 4.0(不是 MVC)网站,用户可以在其中搜索各种项目。搜索/结果功能的工作原理如下:
在搜索页面上,用户填写搜索条件(文本框、下拉列表等),然后单击提交按钮。 on_click 事件处理程序执行一些验证和/或错误检查。如果一切正常,我将创建一个对象来保存所有值并将该对象放入会话中。然后我做一个response.redirect到结果页面。在结果页面上,我从会话中读取对象并联系 wcf 服务并将对象传递给它。 wcf 进行搜索并返回结果(如果有),然后我显示结果。
我很好奇是否有更好的方法来做到这一点。它工作正常,但感觉有些不对劲。我不太热衷于将对象加载到会话中。
我更愿意将对象(带有搜索条件)发送到 wcf,然后进行重定向,让结果页面保持加载,直到我从 wcf 服务返回响应。获得结果后,返回并加载包含结果的页面。
这可能吗?任何反馈/链接将不胜感激。
而且不会有任何第三方使用我们的 wcf 服务,这都是内部的。
I have a c#/asp.net 4.0(not MVC) website where a user can search for various items. The search/results functionality works something like this:
On the search page the user fills out the search criteria(textboxes, dropdowns, etc...), and clicks a submit button. The on_click event handler does some validation and/or error checking. If everything checks out, I create an object to hold all the values and place the object into session. I then do a response.redirect to the results page. On the results page I read the object out of session and contact a wcf service and pass the object to it. The wcf does the search and returns the results(if any) and I display the results.
I was curious if there was a better way to do this. It works ok, but something doesn't feel right about it. I'm not too wild about loading the object into session.
I'd prefer to send the object(with the search criteria) to the wcf, then do a redirect, have the results page hold up loading until I get a response back from the wcf service. Once I get the results, back go ahead and load the page with the results.
Is this possible? Any feedback/links would be appreciated.
Also there won't be any third parties using our wcf service, this is all inhouse.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有三种方法可以做到这一点,
Server.Transfer
/Server.Execute
。There are three ways how to do that
Server.Transfer
/Server.Execute
.