views:

66

answers:

4

I have a web site that runs both classic ASP and ASP.NET Webforms. The sessions for each are separate.

I need to hit some asp page whenever a request is made on the ASP.NET pages.

Why? Because I need to extend the ASP's session so it doesn't expire.

I know this is going to cause a number of issues and I really really don't want to do this, but the decision is not in my hands, unfortunately.

Is there any way to accomplish what I'm trying to do?

+3  A: 

Put a .asp page inside an iframe on the asp.net page? Just clarifying here... You don't need to make the iframe visible. 0px or whatever you want. But load it in the src= attribute.

marcc
Hmm, that's interesting. I was hoping I could do something inside the global.asax. This would require me to have to go into all my pages and change the markup because our asp.net pages don't utilize master pages or anything like that. I like the suggestion though!
Joseph
+1 I like that idea, have a little jquery/ajax call send a hidden request to an asp/asp.net controller page that just loads up "I ran it" in a hidden div.
Breadtruck
@marcc Question: Do I need to make the asp page have server tags inside it or can I just make it a blank html page? Will the server still count that as a hit?
Joseph
@Joesph: I don't know :) Whatever it takes to initialize the asp runtime. It's been too long since I've used classic ASP....
marcc
@marcc Thanks anyway marcc. I'll put in some server side stuff just to be on the safe side =)
Joseph
Is there a reason it needs to be an IFrame? Why not an Img with style="display:none" ?
AnthonyWJones
+1  A: 

Have a link to a do nothing ASP script file in the ASPX page? Or look at something like this.

Update- as you say you don't have master pages or anything like that. You could use an HttpModule to inject the extra HTML required to make the request to the classic ASP page. See here for an article on how to do that, or look at the code for this one. Creating one for your needs wouldn't be difficult. Find where you want to insert it and inject the extra HTML.

RichardOD
I need something that doesn't require the end user to perform any action. This needs to be an automatic kind of thing.
Joseph
I've seen that page during my research. I'm not sure we would be able to implement that, unfortunately. My hands are pretty tied.
Joseph
Something like this would be "automatic" <SCRIPT LANGUAGE="JavaScript" SRC="donothing.asp"></SCRIPT>
RichardOD
@RichardOD Oh I see! Thanks!
Joseph
A: 

This might be a half cocked idea, but maybe on certain pages do a redirect to an asp page, then that page just redirects back to the calling asp.net page, I mean it all depends on what pages do what, but you can see where I am headed with this

Breadtruck
A: 

Add a img tag to the page that targets one of the asp-pages in the application. Add a CSS class to the image that hides it and put something random or the current date in the query string so that it doesn't get cached, just to be on the safe side.

svinto