0

I have been Googling and have not come to any solution, till now. There are two problems:

I have a query string which is quite large, and I need to compress the same using any algorithm in java script and then open a new window.

I need to send data in querystring and open a new tab, I cannot add data in session, as session will shift me on server side and If I will try to open a new tab from server side, it opens in a new window (instead of tab).

My code in Javascript:

  window.parent.open('../ReportWebForm.aspx?ReportType=BasicFundedReport&P1=' + fromdate + '&P2=' + toDate + '&P3=' + InstitutionId + '&P4=' + BranchId + '&P5=' + ContactId + '&P6=' + ProvinceId + '&P7=Applicant Ascending'+ '&P9=' + Text + '&P10=' + Q + '&P11=' + SelectedId + '&P12=' + SubTotalChk + '&P13=' + GroupSubtotalField + '&P14=' + GroupSubtotalOrder + '&P15=' + LenderSelection +'&P16=' + TeamLevel); 

This makes a lot of querystring: So add these parameters in session and try to launch from server side: My code in server side:

 Page.ClientScript.RegisterStartupScript(typeof(string), "", "window.parent.open('../ReportWebForm.aspx?ReportType=FundedReport','Funded Report','height=750,width=1400,left=0px,top=0px,resizable=yes,scrollbars=yes,toolbar=yes,status=yes);</script>");

This opens a new window. So how can I compress querystring? I have been using encodeURIComponent but that doesnt compress it.

Kumar V
  • 8,810
  • 9
  • 39
  • 58
Incredible
  • 3,495
  • 8
  • 49
  • 77
  • `encodeURIComponent` is not for compression it's for `url-encoding`. – शेखर Feb 26 '14 at 06:03
  • Ok what can be the option? GZip? I was not able to get that. – Incredible Feb 26 '14 at 06:04
  • http://stackoverflow.com/questions/11888892/open-page-in-new-tab-asp-net – Seano666 Feb 26 '14 at 06:06
  • As far I know it for compressing file before sending to the browser. – शेखर Feb 26 '14 at 06:06
  • Why compress? You will have to then decompress on the server in order to use the query string. Also check out this (somewhat old) article on query string length limits: http://stackoverflow.com/questions/812925/what-is-the-maximum-possible-length-of-a-query-string. Is your query string really too long? If you want document compression, you can enable that on the server. – jfriend00 Feb 26 '14 at 06:06
  • Sending so much data via querystring...not recommended. Your option would be to somehow manage to send it via a HTTP post where your data would be part of the HTTP body. There are many ways of doing this. – deostroll Feb 27 '14 at 06:22
  • Yes, I did the same. :) – Incredible Feb 27 '14 at 06:46

0 Answers0