在没有会话的情况下将值传递到下一页 [英] Passing a value to next page without session
本文介绍了在没有会话的情况下将值传递到下一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将k的值传递到下一页如何在没有会话的情况下执行此操作,cookies n querystrings
这是一个错误合同,我有与其他应用程序一起使用该服务。
I want to pass the value of k to the next page how can i do it without session,cookies n querystrings
This is a fault contract and i have to consume the service with other application.
public string GetMessage(int i,int j)
{
string k;
try
{
k = (i / j).ToString();
}
catch (Exception exp)
{
MyFaultException theFault = new MyFaultException();
theFault.Reason = "Some Error " + exp.Message.ToString();
//// throw new FaultException<MyFaultException>(theFault);
throw new FaultException<MyFaultException>(theFault, new FaultReason(theFault.Reason));
//throw new FaultException(exp.Message); // For throwing General Exception
}
return k;
}
推荐答案
在页面之间传递值有不同的方法。
参考 - 如何:在ASP.NET Web之间传递值页面 [ ^ ]。
There are different methods to pass value between pages.
Refer - How to: Pass Values Between ASP.NET Web Pages[^].
您好,
请通过以下链接了解您的问题。
使用故障合同
故障合同 - 处理WCF中的错误和非常简单的WCF服务实施
错误合同
Throwing a FaultException< t>来自WCF服务导致'此故障的创建者未指定原因。'
以上链接将帮助您。
谢谢
Hi,
Please go through the following links regarding your question.
use of Fault Contract
Fault Contract - Handling Errors in WCF and A Very Simple WCF service Implementation
Fault contract
Throwing a FaultException<t> from a WCF services causes 'The creator of this fault did not specify a Reason.'
These above links will help you definitely.
Thanks
这篇关于在没有会话的情况下将值传递到下一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文