0

I have two applications and want to pass data within them. Both applications are on different domains and different technology.

Application-1: www.mydomain.com
Application-2: www1.mydomain.com (Notice the "www1")

Application-1 is in Classic ASP using hidden variables and forms. Application-2 is a SPA in AngularJS.

Requirement: Click on a link from classic ASP which navigates you to AngularJS. Clicking "Cancel" on AngularJS page should redirect you back to classic ASP page.

Problem: I can pass Classic ASP page URL in querystring but this page has 50 hidden form variables which I want to pass as well to AngularJS so that I can redirect back from AngularJS page with those form variables.

Naupad Doshi
  • 496
  • 2
  • 5
  • 19

1 Answers1

0

Since there is no issue parsing querystring parameters in Angular, is your issue more around how to easily pass the ~50 form items to your Angular app? If so, you can easily loop through the form elements and append them to a variable like so:

dim queryString

For Each item In Request.Form
   queryString = queryString & "&" item & "=" & request.form(item)
Next 

From there you would append the queryString to the end of your redirect and all of the form elements would be a part of the querystring.

msturek
  • 541
  • 6
  • 17
  • Except with that many parameters and values they are likely to exceed the maximum length of a URL. – Dijkgraaf Jan 21 '16 at 20:29
  • There is no limit in the standard. Browsers do seem to limit, but it's in the tens of thousands of characters the modern ones. Don't know how likely that would be exceeded. – msturek Jan 22 '16 at 00:32
  • Not tens of thousands, it is 2048 characters for the entire URL if you want to support IE10 http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers – Dijkgraaf Jan 22 '16 at 02:16
  • Yeah I forget about IE. The others have much larger limits. – msturek Jan 22 '16 at 03:21
  • Thanks for the suggestions people. But, I don't really want to use Query String to pass data so what will be the other option to implement this? – Naupad Doshi Jan 22 '16 at 14:30
  • @user2272865 A form post http://stackoverflow.com/questions/19985344/angularjs-simple-form-submit – Dijkgraaf Jan 23 '16 at 07:18
  • Is there a way I can use a centralized API that both ASP and AngularJS can call and consume data from? – Naupad Doshi Jan 24 '16 at 09:34
  • just introduce cross domain posting, see this post: http://stackoverflow.com/questions/298745/how-do-i-send-a-cross-domain-post-request-via-javascript no need to pass all that info via the query string – Paul Jan 25 '16 at 20:41