Web服务中的重定向 [英] Redirection in web service

查看:127
本文介绍了Web服务中的重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要尽快提供建议。我有两个带有表单的asp页面,但是我需要在.NET中进行处理,即当用户提交第一个表单时,它会验证所有字段,如果确定数据进入数据库,那么它会将用户重定向到第二页,并预先弹出一些字段。所以我决定创建一个Web服务,它从第一个表单中执行我需要的所有表单字段值,但问题是我不知道如何在处理完成后将用户重定向到下一个表单并且还返回了一些值第一种形式?

如果网络服务不是一个选项,那么您认为在这种情况下我会有什么帮助?如何使用.NET处理所有字段值?就像我说的那样,没有CodeBehind的东西,因为页面是用普通的asp编写的。


提前谢谢。

Hi guys,
I need an advice ASAP. I have two asp pages with forms but I need to do processing in .NET, i.e. when user submits first form it validates all the fields and if ok data goes to database and then it redirects user to second page with some fields pre-popped. So I decided to create a web service which does everything I need with all form field values from first form but the problem is I''m not sure how to redirect user to the next form after processing is done and also having some values returned from the first form?
If web service is not a option then what do you think would help me in this case? How to process all field values using .NET? Like I said there is no CodeBehind stuff since pages are written in regular asp.

Thanks in advance.

推荐答案

内您的asp代码需要通过请求对象将数据发送到Web服务。 Web服务将返回一个响应对象,其中包含您需要的任何数据。在您发送请求的同一个asp页面中,您将检索响应对象。现在,您可以验证响应对象带有数据,并使用响应中的值来分配您将在重定向到的页面中使用的隐藏字段值或会话值。尝试一下,如果你遇到困难就告诉我们。


Nathan
Within your asp code you will need to send data to the webservice via a request object. The web service will return you a response object with whatever data you need in it. In the same asp page that you sent the request in you will retrieve the response object. Now you can verify the response object came back with data and use the values in the response to assign hidden field values or session values that you will use in the page that you redirect to. Give this a try and let us know if you get stuck on something.

Nathan


你可以让webservice返回一个状态(比如 ;好或错误:<错误>")并且基于返回值,页面可以重定向到第二页,或者告诉用户他们需要在可以继续之前更改某些内容。


第二页可以尝试从数据库中获取值吗?
You could have the webservice return a status ( like "Good" or "Error: <error>") and based on the return value the page can either redirect to that 2nd page or tell the user that they need to change something before they can proceed.

Page two can just try and get values from the database?


谢谢大家,我会尝试并让你知道
thanks guys, I''ll try it and let you know


这篇关于Web服务中的重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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