Click to See Complete Forum and Search --> : Few ASP.NET Questions, Gurus


Rohit Kukreti
July 18th, 2003, 08:50 AM
Hi,

I have a few problems answers to which i could not find even on the net.
So gurus if you all can help me pls

1. What is the way of sharing session between Asp and
ASP.Net (is there any way ? of if not what can be the way
out ?)

2. Can we have two form tags in a single aspx page ?
if not why ? and how can we overcome to lack of this feature ?

Waiting for the reply

--
Rohit

coolbiz
July 20th, 2003, 09:45 PM
I am definitely not a Guru but I'll try to answer :)

1. Not easy to do. Since ASP and ASP.NET are processed by different engines (different processes if you may), they can't really share data easily (that is how I understand it anyway). You can really see the difference by looking at the SessionID for ASP and ASP.NET, totally different.

However, you can workaround it by implementing your own SESSION handler. This can be achieved by have a table in a DB where you can store information for the clients temporarily. Whenever a session is started, assign an ID (must be unique - GUID is there to be utilized) and pass this ID from page to page (hidden variable in the FORM or cookie).

2. I read in MSDN once and the answer is NO. Why? It is a Microsoft product. Until now I still can't figure out why. I hope someone will be able to enlighten us with this soon :)

Workaround? Use client scripting to forward the form to the next page.

-Cool Bizs

Rohit Kukreti
July 21st, 2003, 03:39 AM
Hi coolbiz,

Thanx for your replies

---
Rohit

hellomadhu
July 22nd, 2003, 05:51 AM
it's possible to share session between asp & asp.net pages.

have a look at this article

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/converttoaspnet.asp

mummadipartha
July 28th, 2003, 01:33 AM
hi, all

I am new to this forum,
i found something usefull for the questions above,
if it helps you i feel great

You are migrating an existing ASP application to ASP.NET. You want to retain some of the original ASP pages in the new ASP.NET application.

Which SessionStateMode should you use so that Session state can be shared between the ASP pages and the ASP.NET pages?
a. InProc
b. SqlServer
c. StateServer
d. Off

The answer for this is-> A

Explanation is shown below:

You should use the InProc mode. With this mode, Session state is stored in a process on the local machine. This is the only mode that is supported by ASP.

You should not use the StateServer mode. This mode allows Session state to be stored in a process on another machine. ASP does not support this mode.

You should not use the SqlServer mode. This mode allows Session state to be stored in a SQL Server database. ASP does not support this mode.

You should not use the Off mode. This mode disables Session state for the application.
regards
Reddy

coolbiz
July 28th, 2003, 07:38 AM
Hi Reddy,

If you ponder a little more on the meaning of INPROC, you'll realize that it is definitely NOT the way to go. Remember that ASP and ASPX engines are totally 2 different things. So having them running the SESSION state as INPROC meaning each one of the engines have a copy of their own. And since they are running on 2 different processes, they can't really share (easily).

Both of them do know how to use INPROC but in order to share you'd need an external storage for your SESSION states. That is why the link provided by HELLOMADHU explains the use of COM and SQLSERVER as the common method to store and retrieve SESSION states.

Good Luck,
-Cool Bizs

mummadipartha
July 28th, 2003, 10:15 AM
hi, coolbiz

that's great the answer was concise and made me clear about sessions..

thanks
Reddy

94Stangfan
August 21st, 2003, 05:44 PM
You can have more than one form on your page, The problem is that you can only have 1 Webform.

The idea behind this is pretty simple, you have button click events that you can have executed. Since you know which button was clicked, you can process the form as you need.

Because each button has it's own click event, this eliminates the need for multiple web forms.

You can use as many HTML forms as you would like.

Just in case you were not aware, a WebForm is a form that has a runat=server in the tag.

An HTML form does not have a runat= attribute at all.

Hope that helps.