473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Combining ASP and ASP.NET projects together

Hi there

I have several bigger applications programmed with the old ASP (vbscript). A
lot of data is stored in the session object.

Now I have to extend the application with new functionality (-complete new
part). My idea is to develop the new part in ASP.NET (C#) and leave the old
parts in the ASP environment. With this way I can migrate the old code step
by step into C# and I don't need to migrate the whole project in one step (->
I also have to migrate all test cases as well. And there are a lot of test
cases).

Is it possible to share data in the session object? I think this is not
possible because there are different session managers for the asp and the
asp.net session. Or am I wrong?

Any help is welcome.

Regards
Roger
Dec 4 '06 #1
3 2354
"Roger" <Ro***@discussions.microsoft.comwrote in message
news:30**********************************@microsof t.com...
Is it possible to share data in the session object? I think this is not
possible because there are different session managers for the asp and the
asp.net session. Or am I wrong?
You are wrong - all you have to do is use a database.
Any help is welcome.
There are hundreds of examples on the web - that's what Google is for:
http://www.google.co.uk/search?sourc...+Session+share
Dec 5 '06 #2
Right. You cannot share session objects because of different session
managers.

What I've done in similar situations is to have a "gateway page" between
both apps.

Something like this :

mypage.asp -ASPGateway.asp -ASPNETGateway.aspx -DestinationPage.aspx

1. mypage.asp has a link like:
ASPGateway.asp?destination=DestinationPage.asp&opt ionalQueryStringElements=XXX

2. ASPGateway.asp adds all your session object Collection (works only on
simple datatypes) and dump them in to a HTML form, wich immediately posts
itself to ASPNETGateway.aspx

-- ASPGATEWAY.asp --
<HTML>
<BODY>
<FORM id="form1" action="ASPNETGateway.aspx?<% = Request.queryString %>"
method="post">
<input type="hidden" name="SessionObject_Item1" value = "<%=
Session("item1")%>">
<input type="hidden" name="SessionObject_item2" value = "<%=
Session("item2")%>">
<input type="hidden" name="SessionObject_item3" value = "<%=
Session("item3")%>">
<%
'include what is being sent in the request.Form
for each item in Request.Form
response.write "<input type=hidden name='" & item & "' value='" &
Request.Form(item) & "'>"
Next
%>
</FORM>
<script language="JavaScript" type="text/JavaScript">
form1.submit();
</script>
</BODY>
</HTML>
-- End of ASPGATEWAY.asp --

3. ASPNETGateway.aspx is an aspnet page. here you pick everything from the
ASPGATEWAY.asp post and put it on the aspnet session object (if its name
starts with "SessionObject_" )

-- ASPNETGATEWAY.aspx ---
<HTML>
<BODY>
<FORM id="form1" method="post">
<%
for each item in Request.Form
if item.toString().startsWith("SessionObject_") then
Session(item.toString().replace("SessionObject_", ""),
request.Form(item))
else
response.write "<input type=hidden name='" & item & "' value='" &
Request.Form(item) & "'>"
end if
Next
%>
</FORM>
<script language="JavaScript" type="text/JavaScript">
form1.action="<% = request.Querystring("destination") & "&" &
request.querystring("optionalQuerystring")%>"
form1.__VIEWSTATE.name='ignore';
form1.__VIEWSTATE.value='';
form1.submit();
</script>
</BODY>
</HTML>
-- ASPNETGATEWAY.aspx ---

That should help you pass session variables between asp and aspnet
applications. this would help also if you used forms authentication to
authenticate between apps.

(I'm doing this on my mind... there might be mistakes all over)

Hope it helps,

Armando Canez
Dec 5 '06 #3
Could there be a better way? ... well... it depends...

Your ASP app could be easyly converted using a tool, depending on the size
and complexity of it, but there's no assurance it wouldn't have problems
after conversion.

Depending on the design of the app, maybe the way to go is to keep the ASP
app and use .NET web services for new or unavailable functionality in ASP.

Another way is to keep developing it in 100% ASP. Maybe the time and money
needed to rewrite that particular app is not worth it (if the customer is
not going to pay for it). Remember COBOL :)

And a third would be to try and design the new ASPNET pages in a sessionless
environment, and pass the ASP session variables in form hidden inputs

I was in your particular spot once, and I decided to do a COMPLETE rewrite
of my ASP app. It took A LOT of time and money, but it was the right
decision FOR MY CASE.

Armando Canez
-------------------------
"Roger" <Ro***@discussions.microsoft.comwrote ...
Could it be a better way to completly convert an asp application into an
asp.net application (with a converter if exists)? Did you have a lot of
problems after converting an asp application (-dynamic code like client
side java scripts or other "features")??

Dec 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Nau | last post by:
I've been trying to get a concrete answer to this for the last few days, but have come up short. I'm hoping someone here can help. Is there a way to take a set of c# modules (c# code compiled...
5
by: davidw | last post by:
I am using microsoft development enviroment 2003. I created a solution, and have some projects, I put the root dir as my IIS home, and each project has their own directory, so it is like ...
16
by: Robert W. | last post by:
I'm building a solution that has 1 component for the Desktop and 1 component for the Pocket PC. (Though this isn't a mobile question). I have a data library that will be shared on both platforms....
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
7
by: Joe | last post by:
Hello All: I have a solution with four projects (UI, Business, Database and Messaging). UI has references to Business and Messaging; Business has a refernce to Database; Messaging has a...
2
by: y1799 | last post by:
Hi, I have such problem: I created 1 solutions that contains 1 exe project and 1 dll one. I Added reference of dll project (not file, project) to exe project, set dependencies (exe depends of...
1
by: kkjensen | last post by:
Hi there, I've got a problem that I'm sure is simple to someone with more experience. I have three tables: clients, tools and projects. Two of the fields in projects are linked to clients and...
1
by: Rowan | last post by:
Hi there, I recently posted an architecural question that I got quite a bit of help from and am now stuck again. I have two projects though I look at them as one with two presentation...
3
by: Koolioman | last post by:
I've made several programs, and I want to make another that links through a linked label to all of them. How do I do that? I've tried copying the entire project into a message box, but of course that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.