how to not send a silentpost in asp.net C#

K

khawar

the following code seams to be sending a silent post. how
can we not make it send a silent post but regular post
where along with the post the control should also be
transferred over to the other page on the server,(like a
link)

using System.Drawing;
using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Mail;
using System.Collections;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Text;
using System.Web;

public class MyCodeBehind : Page{
public TextBox login, partner, type, amount, user1;
public Button send;
public Label msg;

public void send_Click(object sender, EventArgs e){
string login_s = login.Text;
string partner_s = partner.Text;
string type_s = type.Text;
string amount_s = amount.Text;
string user1_s = user1.Text;

ASCIIEncoding encoding=new ASCIIEncoding();
string postData="Login="+login_s;
postData += ("&partner="+partner_s);
postData += ("&type="+type_s);
postData += ("&amount="+amount_s);
postData += ("&user1="+user1_s);
byte[] data = encoding.GetBytes(postData);

// Prepare web request...
HttpWebRequest myRequest = (HttpWebRequest)
WebRequest.Create
("https://payflowlink.verisign.com/payflowlink.cfm");
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
myRequest.Timeout = -1;

Stream newStream=myRequest.GetRequestStream();
// Send the data.
Response.R
newStream.Write(data,0,data.Length);
newStream.Close();
}
}
 
J

John Saunders

khawar said:
the following code seams to be sending a silent post. how
can we not make it send a silent post but regular post
where along with the post the control should also be
transferred over to the other page on the server,(like a
link) ....
public class MyCodeBehind : Page{ ....
public void send_Click(object sender, EventArgs e){ ....
byte[] data = encoding.GetBytes(postData);

// Prepare web request...
HttpWebRequest myRequest = (HttpWebRequest)
WebRequest.Create
("https://payflowlink.verisign.com/payflowlink.cfm");
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
myRequest.Timeout = -1;

Stream newStream=myRequest.GetRequestStream();
// Send the data.
Response.R

What's the Response.R?
newStream.Write(data,0,data.Length);
newStream.Close();

I'm not sure this is your problem, but I'd suggest you read the response.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top