Using query string in excel hyperlink for ASP.Net web application

I want to transfer some data between an existing excel application and an existing ASP.NET VB Webforms application.

I thought that a hyperlink with some query string variables would be the easiest way to do this. However, the hyperlink does not seem to save the registered user session.

Testing this with the same URL on a webpage really works. So, it seems that Excel is starting a new session. Any ideas on how to make Excel hyperlinks behave the same way a browser hyperlink does?

+3
source share
4

, Fiddler , Excel , .

: , , , . - cookie .

(redirect.htm);

<html>
<body>
Please wait, loading your page... 
<script type="text/javascript">
<!--
function getQuerystring(key) {
key = key.replace(/[\[]/,"\\\[").replace(/    [\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var query = regex.exec(window.location.href);
return query[1];
}

window.location = "http://site-page/" + getQuerystring('page'); //-->
</script>
</body>
</html>

http://site-page/redirect.htm?page=this-sub-page - .

+5

, Firefox . IE , . , .

, . Excel , IE7, URL- .

:

"GET /ar/vehicle.php?rv_id=9046 HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1 ...
"GET / HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1 ...
"GET /?q=node/57 HTTP/1.1" 200 6231 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1 ...
"GET /?q=node/57 HTTP/1.1" 200 8318 "-" "Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0 ...

: Excel . - , .

+1

Excel , , . Excel , - , .

, URL- ( , ..), , cookie ?

0

,

.

php script, , "ms-office", !

:

if (strpos($_SERVER['HTTP_USER_AGENT'],'ms-office') === false) {
    header("Location: ".$_GET['url']);
}

excel, . redirect.php? url = http://google.com

0

Source: https://habr.com/ru/post/1715524/


All Articles