472,332 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,332 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 1311

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...
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...
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...
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...
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...
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...
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...
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: ...
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...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.