Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.

C#
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;
        }
Posted
Updated 6-Aug-13 1:53am
v2
Comments
Ankur\m/ 6-Aug-13 7:49am    
How do you go to the next page - Response.Redirect ?
shacha 6-Aug-13 7:51am    
It is fault contract in WCF so i have to consume it using my application if there is no error result should be displayed and if there is a exception error will be shown.
ZurdoDev 6-Aug-13 8:00am    
So when you get the response back from the service, handle it however you need.
So, what is the problem here. You must be getting the value of k after the service call.
Pass that value to the next page.
shacha 6-Aug-13 8:05am    
I dont want to pass the value using session n query string any alternative?

There are different methods to pass value between pages.

Refer - How to: Pass Values Between ASP.NET Web Pages[^].
 
Share this answer
 
Comments
Joezer BH 6-Aug-13 10:43am    
5ed!

I would emphasize the option of the query string params, which looks like what shacha is looking for.
Thanks a lot Maimonides... :)
 
Share this answer
 
Comments
Sridhar Patnayak 6-Aug-13 8:49am    
This is not right way to answer the question. because it is not concept to read your links and implement. Just it is syntax issue.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900