Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with merging ASP and ASP.NET 1

Status
Not open for further replies.

fdarkness

Programmer
Feb 17, 2006
110
CA
Please bear with me... it's kinda messy! :)

I have a main application that I wrote in ASP. A second part of the application was contracted out to another developer who did it all in ASP.NET. I need to merge the two of them together (without rewriting everything from scratch) so they work. Fortunately, all that really needs to be done is design and layout stuff, so it's not too difficult. Each application is also stored in a separate directory, making each a stand-alone to some degree.

The problem I'm running into deals with linking from the main index page (ASP) to the timesheet section (ASP.NET).

Due to how the servers are set up, users have to link to a ColdFusion page on a separate server, which grabs their UserID (based on their NTLogin). It then passes it as a hidden form variable to the actual application (ASP) which stores it as an application variable, which invisibly allows the user to log into the application.

I was able to code this for the ASP.NET page in a separate linking page in ColdFusion, but I need to set it up to do it from the ASP page.

The problem I'm running into is that clicking the link to the ASPX page from the ASP page either causes the application variable to disappear *or* it's not being properly assigned.

I have two global files... in the root directory, I have global.asa and in the timesheet directory (ASP.NET) I have global.asax. Both set the application variable to UserID, but I *suspect* that global.asax is overriding global.asa when going into the timesheet application and because the UserID isn't being "submitted" through the main ASP index page, it's getting assigned to blank.

Is this the case? If so, is there a way around this, possibly going down to one global page? But will one global page work for both the asp and aspx pages? Or should I write my index page to have the links act as "submit" and set the UserID as a hidden form variable and resubmit it when the user clicks on the link to the timesheet pages?

I know this is all messy, but I wasn't aware that the second application was going to be written in .NET and my boss didn't inform the contractor that the main app was in ASP. And because the site is hosted on a development server instead of production (it's all internal), I have to deal with weird login issues. Yeah, it's convoluted, but it's all I have to work with. :/
 
The problem you are having is that session and application variables are not easily passed between classic ASP and .NET. I have done it in the past and I can't remember how. If I can somehow get access to the project, I will let you know how I did it. I did eventually find the answer searching on google. I think I had to store the values I wanted to pass in hidden fields. If I can get access to that project, I will give you a definate answer. In the meantime, try searching Google.

Jim
 
Well I managed to pull it off!

Nothing like writing a post here and coming up with an idea that *might* work.

I set the link on the ASP index page to the timesheets as:

Code:
<form method="post" action="/timesheet/UserMain.aspx" name="timesheet_form">
	<input type="hidden" name="UserID" value="<%=Session("UserID")%>">
	<b><li><a href="javascript:document.timesheet_form.submit();">Timesheet Application (Available Nov 1, 2006)</a></li></b>
</form>

And it works perfectly.

Except that I hate using a big honking hammer to make my code do what I want it to do. I'm going to really regret having it set up as this way in the long run.
 
Excellent.. that is bascially what I was thinking I did. It was like 3 years ago. Great glad you got it, and I will have to remember for next time...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top