473,396 Members | 1,886 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,396 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 5549
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.