473,399 Members | 4,192 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,399 software developers and data experts.

simple form question

I have a simple form question. I order to access a payment gateway I have a
asp.net page which has to have a form that use POST for method and _blank for
target. Before the information of the form can be send of, a checksum has to
be calculated. I want to calculate the checksum server side for security
reasons. The way I do it the checksum is not calculated before the form I
posted. The following is simplified content of the aspx .
<html>
<header>
<%@ Import Namespace=”System.Security.Cryptography “ %>
<script language=”C#” runat=”server”>

void Page_Load(Object sender, EventArgs e) {
PageDataBind();
}

string makeMD5( string s) {
return MD5(s); // The code here is VERY simplified
}

</script>
</header>
<body>
<form id=https://secure.paymentgateway.com/window.php method=”post”
target=”_blank”>
<input type=”hidden” name=”checksumMD5” value=<%# makeMD5( makeMD5(
amount.Value.ToString() ); %> />

<input type=”text” id=”amount” runat=”server” />

<input type=”submit” value=”submit>

</form>
</body>
<html>
I have also tried to let form=”server” and that way calculate in a cs file
server side. I just could’t if any function I C# waould let me form posting
to the payment gateway page.

Any suggestions?

Thanks in advance for any help,
Dec 5 '05 #1
1 1516
Hi adam,

You have a couple of problems here. First, if you use a WebForm, you can't
post to a remote server; a WebForm posts only to itself. Second, if you add
a form or put a form outside of a WebForm, you cannot add Controls to it.

From what I can see, you have 2 alternatives:

1. Use a WebForm in the page, and add a second form to the page dynamically,
by adding literal HTML to the page, and filling in the dynamicparts via
Response.Write to the page inside the HTML form. It cannot have any
WebControls in it, but you don't need WebControls to do a POST.
2. Do your POST on the server-side using a WebClient. Grab the contents from
the Response, and put them into a page that is popped up by the WebForm via
JavaScript, when it returns to the client.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.

"adam" <ad**@discussions.microsoft.com> wrote in message
news:64**********************************@microsof t.com...
I have a simple form question. I order to access a payment gateway I have a
asp.net page which has to have a form that use POST for method and _blank
for
target. Before the information of the form can be send of, a checksum has
to
be calculated. I want to calculate the checksum server side for security
reasons. The way I do it the checksum is not calculated before the form I
posted. The following is simplified content of the aspx .
<html>
<header>
<%@ Import Namespace="System.Security.Cryptography " %>
<script language="C#" runat="server">

void Page_Load(Object sender, EventArgs e) {
PageDataBind();
}

string makeMD5( string s) {
return MD5(s); // The code here is VERY simplified
}

</script>
</header>
<body>
<form id=https://secure.paymentgateway.com/window.php method="post"
target="_blank">
<input type="hidden" name="checksumMD5" value=<%# makeMD5( makeMD5(
amount.Value.ToString() ); %> />

<input type="text" id="amount" runat="server" />

<input type="submit" value="submit>

</form>
</body>
<html>
I have also tried to let form="server" and that way calculate in a cs file
server side. I just could't if any function I C# waould let me form
posting
to the payment gateway page.

Any suggestions?

Thanks in advance for any help,

Dec 5 '05 #2

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

Similar topics

13
by: LRW | last post by:
Having a problem getting a onSubmit function to work, to where it popsup a confirmation depending on which radiobutton is selected. Here's what I have: function checkdel() { if...
2
by: not | last post by:
Hello All, I am trying to develop a relatively simple self-quiz form in javascript, but I'm having no luck getting it to work. What I am looking for is a script that allow the user to select...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
4
by: pcnerd | last post by:
I originally asked this question in the "classic" VB forum. It occured to me after I had sent it that I sent it to the wrong forum. Anyway! Here's the situation. I have VB.NET 2005 Express...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.