473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

having trouble sending a post in asp.net using C#

here is my code that i am using to send the post to
verisign:
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 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;
Stream newStream=myRequest.GetRequestStream();
// Send the data.
newStream.Write(data,0,data.Length);
newStream.Close();
}
}
and i am getting the follwing error message:
Server Error in '/' Application.
-----------------------------------------------------------
---------------------

The operation has timed-out.
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.Net.WebException: The operation
has timed-out.

Source Error:(line 45 is in red color, meaning the error
is in that line)
Line 43: myRequest.ContentType="application/x-www-
form-urlencoded";
Line 44: myRequest.ContentLength = data.Length;
Line 45: Stream newStream=myRequest.GetRequestStream
();
Line 46: // Send the data.
Line 47: newStream.Write(data,0,data.Length);
Source File:
D:\root\fitfreak\trainwithdom.com\www\launch.cs Line:
45

Stack Trace:
[WebException: The operation has timed-out.]
System.Net.HttpWebRequest.GetRequestStream() +190
MyCodeBehind.send_Click(Object sender, EventArgs e) in
D:\root\fitfreak\trainwithdom.com\www\launch.cs:45
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
+108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEve
ntHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277

-------------------------------
Can some please help, I will appriciate it highly
thanks

Nov 17 '05 #1
0 1375

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
1
by: Anand | last post by:
Hi i am having trouble adding a recordset into the access database, the code seems to be working fine it passs and parses through all variables just fine without showing any errors and also when i...
0
by: Mark Miller | last post by:
I'm puzzled by this situation. I'm running on Windows XP Pro 2002 SP 2. I started on an ASP.Net project, initially using the standard SmtpServer and MailMessage classes. For testing, I used the...
22
by: ext_u | last post by:
I'm trying to learn C from "The C Programming Language" (by K&R) and I am about halfway through the first chapter. I am using Miracle C as my text editor and compiler. Up until this point...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
9
by: Christian Blackburn | last post by:
Hi Gang, I don't know what to make of all of this, but I'm having nothing, but trouble copying data to the clipboard which should be the easiest thing in the world. The only systems I can get...
27
by: stonemcstone | last post by:
I've been programming in C for years, and never experienced troubles until I started using the new RealC-32, a freeware C compiler from the same company that makes RealPlayer and Quicktime. That's...
5
by: tkondal | last post by:
Hi all. I just started looking at Python's ctypes lib and I am having trouble using it for a function. For starters, here's my Python code: from ctypes import*; myStringDLL=...
3
by: =?Utf-8?B?U0FM?= | last post by:
I have not used Delegates before and I am having trouble using them in my app. Here is what I am doing. 1. I have created a C# InterOp Dll that I make calls to, that in turn calls methods in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.