将参数传递给ICICI支付网关

时间:2016-08-03 13:44:34

标签: c# payment-gateway

我将参数传递给ICICI支付网关,但我在异常情况下收到以下错误:

无法评估表达式,因为代码已优化或本机框架位于调用堆栈之上

以下是我的C#代码:

HttpResponse response = HttpContext.Current.Response;
response.Clear();

StringBuilder s = new StringBuilder();
s.Append("<html>");
s.AppendFormat("<body onload='document.forms[\"form\"].submit()'>");
s.AppendFormat("<form name='form' action='{0}' method='post'>", "http://payment.xyz.com/Test.aspx");

s.AppendFormat("<input type='hidden' name='userID' value='" + RegId +" ' />");
s.AppendFormat("<input type='hidden' name='Amount' value='" + lbl_amount.Text + "' />");
s.Append("</form></body></html>");
response.Write(s.ToString());
response.End();

页面也会重定向到http://payment.xyz.com/Test.aspx并在此网址中收到错误:

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

0 个答案:

没有答案