0
votes

My requirement is to pass a session value from aspx page to asp page. Let me explain you everything in details.

I have one asp page from where I am doing one Server.Execute to another asp page. In the second asp page I have one Iframe which calls one aspx page where I need to fetch some data from database with some other functionality added.

My problem is to send a session value from aspx page to the first asp page. But I am not able to get the session value.

Can anyone please let me know how can I do this?

Many Thanks Dipa

2

2 Answers

0
votes

I should clear you about Server.Execute()

When Server.Execute is used, a URL is passed to it as a parameter, and the control moves to this new page. Execution of code happens on the new page. Once code execution gets over, the control returns to the initial page, just after where it was called. However, in the case of Server.Transfer, it works very much the same, the difference being the execution stops at the new page itself (means the control isn’t returned to the calling page).

I believe now it should be pretty clear to you how to call your pages.

0
votes

You could add an iframe in your aspx page which target to a asp page like

xxxx.asp?param=<%=session["sessionkey"]%>

Sorry , I donnt know what your asp page do . And what you want your aspx page do. If just transfer the session value , there are 2 ways to transfer the session value.

1, Get Data with Url Parameter.

 /* Like above solution , IFrame just one way of  this soutions.
 I means you can transfer the session value by url parameter.
 In above sample , your asp page (xxx.asp) should get the param at first like */ 

Request.Get("Param")

2, Post Data with Ajax

 //You can use ajax in your aspx page like

$.ajax({
   type: "POST",
   url: "some.asp",
   data: 'param=<%=session["sessionkey"]%>',
   success: function(msg){
     alert( "Data Transfered: " + msg );
   }
 });