|
hello,
after a client make a payment "paypal" sends a "form" that include all the variables (for ex: payment_date,transaction_id ...), the form is sent to a specific URL which is my server (for ex: http://66.25.123.112/paypal/request.aspx)
how to read the form so the variables appear in my page?which classes or method should i use?
please if someone could help ASAP
THANK YOU A LOT
|
|
|
|
|
Which method of paypal u r using?
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
modified on Friday, January 04, 2008 10:04:07 AM
|
|
|
|
|
dear rahul;
the "BUY now" method , but the problem is how to read from the sent message, as i said before, they sen all the information to a URL i already specified in "notify_url" function (according to paypal)
thank you for your help
|
|
|
|
|
Here is the code I use to post a request to Authorize and get a response. I don't think any of it is specific to them, just plug in the right variables.
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create((transaction.TestRequest) ? testurl : url);
objRequest.AuthenticationLevel = System.Net.Security.AuthenticationLevel.MutualAuthRequired;
objRequest.Method = "POST";
objRequest.ContentLength = strPost.Length;
objRequest.ContentType = "application/x-www-form-urlencoded";
try
{
myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(strPost);
}
catch (Exception e)
{
return null;
}
finally
{
if (myWriter != null)
myWriter.Close();
}
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
dear christian
i already send my variables while clicking "Buy Now" button the problem is when they send back IPN to my url(ex:55.62.65.23/paypal/anything.aspx)
the anything.aspx page should read the sent variables (ex:transaction_id...) so what classes or method read and store it in my database or XML file
thanks a lot
bachirium
|
|
|
|
|
HI
U r sending all the required parameter to paypal via query string or
by hidden field. If u r payment got successed then user will be
redirected to success_url. Then it will send you all the values
via query string. U can read this values as follows.
dim tid as string = Request.QueryString.Get("txn_id")<br />
dim amt as string = Request.QueryString.Get("payment_gross")
Paypal will send to all information about to payer and the merchant.
you can read all the values through query string.
Regards.
Rahul
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
|
Hi All,
I created listener for POST message from client as a simple web page and process that message in Page_Load method. If I use url for posting message to my listener with explicit web page name http://myserver/formhandler/listener.aspx it works without error. But my clients will need to post message using url without mentioning page name like this http://myserver/formhandler. In IIS for formhandler virtual directory I set default document as listener.aspx. And now my issue starts: server responds every time with error 405 Method not allowed. I set properly mapping for aspx extension in configuration to allow POST method.
I would greatly appreciate if anyone can point me what else I have to set to overcome this issue.
Thank you very much in advance,
Roman
|
|
|
|
|
Hi,
I'am ASP.NET 2005 and I am trying to check size of an upload file and limit user if file size>1000kb? I success to limit user for upload only pictures, as following my code.
I need the code in Javascript, I already did it at server side validation.
<script language="javascript" type="text/javascript">
function onSubmitForm(source,arguments)
{
var formDOMObj = document.getElementById("ctl00_ContentPlaceHolder1_UserDataFormView_FileUpload1");
var vld=document.getElementById('ctl00_ContentPlaceHolder1_UserDataFormView_VldUpload1');
var isvalid=false; //Init
if (formDOMObj.value != "")
{
//File type
var strLocation = formDOMObj.value;
var strFile = strLocation.split(".");
var arrFileExtension = new Array(7)
arrFileExtension[0] = "JPG";
arrFileExtension[1] = "JPEG";
arrFileExtension[2] = "GIF";
arrFileExtension[3] = "BMP";
arrFileExtension[4] = "TIF";
arrFileExtension[5] = "TIFF";
arrFileExtension[6] = "PNG";
var len = arrFileExtension.length;
var x=0;
for (x=0; x<len; x++)
{
if (strFile[strFile.length - 1].toUpperCase() == arrFileExtension[x].toUpperCase())
isvalid = true;
}
if (isvalid==false)
{
vld.errormessage="jpg jpeg png gif bmp tif tiff ";
arguments.IsValid = false;
return;
}
}
//Now check file size
??????????
arguments.IsValid = isvalid;
}
Please help
|
|
|
|
|
I think you probably need to use Server-side script for that.. In server-side, you can use this code FileUpload.PostedFile.ContentLength to get the size of file..
|
|
|
|
|
Thanks but as I said I already did it at server side. This is not the bet thing because before server side validation the posatback clear the fileupload textbox
Shay Noy
|
|
|
|
|
Hi,
I agree. Use server side instead, you could store the contents of the textbox in a variable and then you code it to put that variable into the textbox.
Hope it was useful.
Lloyd J. Atkinson
|
|
|
|
|
Thanks, can you show me how to save in temporary variable and to fill the FileUpload textbox.
Shay Noy
|
|
|
|
|
Hi,
Im sorry but I tried to use it the way I had suggested but I didnt realise that the FileName property of the component was readonly, I tried:
Partial Class _Default
Inherits System.Web.UI.Page
Dim TempVar As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
FileUpload1.FileName = (FileUpload1.PostedFile.ToString)
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
TempVar = FileUpload1.PostedFile.FileName.ToString
End Sub
End Class
But then it complained and said: "Property 'FileName' is 'Readonly'."
Well, I tried but couldnt figure out how to do it, sorry.
Lloyd A.
Lloyd J. Atkinson
"Logic will get you from A to B, but imagination will take you everywhere" -ALbert Einstein
|
|
|
|
|
|
You can't check the file size using Javascript, you can't access the file system of the client computer.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I can something else. I can onchange event of the FileUpload object display the selected image on image object (all of this in client side) and then check the size of the object. The problem is that I am not succeed to display the picture. What is the prblem?
See my code:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<script type="text/javascript">
function upload() {
var oThumbnail = document.getElementById("imgThumbnail");
filename = document.getElementById('myfile').value;
oThumbnail.src = "file:///" + escape(filename).replace(/%5C/gi,'/').replace(/%3A/gi,':');
oThumbnail = null;
}
function getSize(oImg)
{
if (oImg.fileSize >-1) {
document.getElementById('sizespan').innerHTML = oImg.fileSize;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
File: <input id="myfile" name="datafile" type="file" size="40" onchange="upload();" />
</form>
<div id="sizespan"></div>
<div id="thumbnail">
<img id="imgThumbnail" src="" alt="place holder" width="50" height="50" onload="getSize(this);"/>
</div>
</body>
</html>
What 's wrong?
Thanks
Shay Noy
|
|
|
|
|
You'll need to use something like this[^] or this[^]. Both work on the server side.
Jon Sagara
On a traffic light yellow means yield, and green means go. On a banana, it's just the opposite, yellow means go ahead, green means stop, and red means, where'd you get that banana?
-- Mitch Hedberg
.NET Blog | Personal Blog | Articles
|
|
|
|
|
In order to ajaxify the website ,I firstly , invoked a master page, then an another page and selected the same master page for that.Now in the page in inserted the table control and in the first row , I drag dropped the Script Manager control.then in souce file, it was showing the following error.
Element Script Manager is not a Known Element.This can occur if there is a compilation error in the website
There is no problem in the script manager tag , if i don;t select the master page for any web page.
Any idea?
|
|
|
|
|
Hi all,
I want to know that what is the alternative of servlets in Asp.Net as we can't use servlets in Asp.Net.Urgent responce will be Appritiated.
Regards,
chanzeb chaudhary
|
|
|
|
|
chanzeb wrote: Hi all,
I want to know that what is the alternative of servlets in Asp.Net as we can't use servlets in Asp.Net.Urgent responce will be Appritiated.
Here you go[^]
|
|
|
|
|
chanzeb wrote: Urgent responce
No.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Hello Friends,
I want to display image(s) in the datagrid. I'm storing images name in a field and a folder name into another field
c:\Images\1.jpg
for example "Images" is the folder name and 1.jpg is the image name .............
And also i've done it if i store Foldername with Filename in the same field. But i don't want to use this method because of some probs.
So plz suggest me the way .................
|
|
|
|
|
What problems are you having storing the folder name and file name in the same field?
Are the \ characters causing the problems?
If so you can escape the \ character like so:
string a = @"c:\Images\1.jpg";<br />
string a = "c:\\Images\\1.jpg";
Storing the separate path values in separate fields will cause you more problems if you create nested folders.
|
|
|
|
|
Hi friend i want to create Grid View Skin by my self i define a css class but the problem is that its Header and footer r not going on to be set
plz any body tell me ab out that
wasim khan
|
|
|
|