473,320 Members | 1,955 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,320 software developers and data experts.

ASP.NET / C# - Response.Redirect() with an encrypted value

JKing
1,206 Expert 1GB
Hey,

I recently was added to a project that was well underway and I'm a little out of my element. I don't normally do web programming so I am having some trouble and I have to say I'm a little stumped at the moment.

I'm using a Response.Redirect to send the user to a new page with posted values. Was working beautifully... then I moved on to encrypting the values. Now everytime I try to do the Response.Redirect I just get "The Page Cannot Be Displayed".

Here's a look at the code from the C# button click event:
Expand|Select|Wrap|Line Numbers
  1. string url = "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_s-xclick&encrypted=-----BEGIN PKCS7-----MIIIzQYJKoZIhvcNAQcDoIIIvjCCCLoCAQAxggE6MIIBNgIBADCBnjCBmDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRUwEwYDVQQKEwxQYXlQYWwsIEluYy4xFjAUBgNVBAsUDXNhbmRib3hfY2VydHMxFDASBgNVBAMUC3NhbmRib3hfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMA0GCSqGSIb3DQEBAQUABIGAJ13L7i1yyJrcxxLnDdS/dFMMhLDmEMWZrhwtltg+NVrJiLk4m6Ndzp6qqJmrfe9WBcFypoB1yY/7fVJ/qFQcFOhRN36jAKqepvY+9cK9NoYbvj9uXtHNFkwfSx811TPvZBHAYAEcernHMBXvBTsxTPGbwu4bHnNL8SPc7zPb66wwggd1BgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECDgQXI+aEz0sgIIHUOQdaYzHh1EDsSNOHU2A9hSebyCEtsLYPt/4AXjS490DOuMos2NgmYjrPzYfqd//Y9aG6x0xi0SnBLZplt9xI2+2gyDroxDRhum4ifD0erhIGGnN9JBu4ca1Gz1zxzq5q4EyO7VdmfsWA07DaPreHTE5+76MBtto7ukxUkn1TJDRHCO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PRuPKiczydf0AYQUd2H19LO1qAFepEH8gZecDuMn8ndVextiKnVZ1OdWXsU2AnaHi/P+kbn4PWvHD3xwwv7QmV8jFiX6daztfm2Eovyd0Qhkwz7iGz36gLd/iKq4GrcMKnjBeUZsSe7vMlh9H69GrE6Wk6g==-----END PKCS7-----";
  2. Response.Redirect(url);
  3.  
Sorry about the giant block of encryption but I didnt want to leave anything out. IIt may appear with spaces but I can assure you there are none.

The only thing I can think of is that some of the symbols in the encrypted value maybe causing a problem. Though I've yet to see documentation that says so.

Now I was worried the encryted string may be wrong so I have tested that using a simple html form with a submit button and POST action with the variables cmd and encrypted hidden and being assigned their respective values. All is well this way but I really need to get it to work through a Response.Redirect or another similar method.

Thanks in advance,
Jared
Dec 14 '07 #1
4 5547
JKing
1,206 Expert 1GB
I found a work around by calling a script in the html form to dynamically populate the hiddin variable encrypted.

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="encrypted" value="<%=GetEncryptedString()%>" />
  2.  
Thanks.
Dec 15 '07 #2
kenobewan
4,871 Expert 4TB
Better way, was you url string over 2048?
Dec 15 '07 #3
JKing
1,206 Expert 1GB
I'm not positive but I'm pretty sure it's over 2048 characters long if that's what you are asking. The strings are dynamic as well so the length will vary.
Dec 16 '07 #4
kenobewan
4,871 Expert 4TB
Any over 2048 are unlikely to work, plus sending encrypted data via url not a good method.
Dec 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bill | last post by:
I have a page that contains processed variables that I'd like to forward using the response.redirect method. However, because the response.redirect contains the page within "pagename.asp", I have...
3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
13
by: TinyTim | last post by:
I'm a newbie at ASP & HTML. It seems that when you use server side code and you're going to return a customized HTML form with several fields and labels, you have to do an extensive amount of...
13
by: Tim | last post by:
Hello, Is there a way to "cancel" a response.Redirect? For example, in the code below, could I insert anything in the Catch statement that would cancel the redirect and resume flow after the...
10
by: Niggy | last post by:
I get an error - any help appreciated. System.Threading.ThreadAbortException: Thread was being aborted. at System.Threading.Thread.AbortInternal() at System.Threading.Thread.Abort(Object...
3
by: tshad | last post by:
I am using method=POST in my Form field, but am also using response.redirects to go to my next pages. response.redirect("x.aspx?a=1) But the a=1 shows in the query string. I thought the Post...
2
by: Mark Rae | last post by:
Hi, I have a fairly simple site, the vast majority of which is available to everyone on the public internet. However, the site has one section which requires logon via the standard...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.