views:

279

answers:

4

can i integrate asp and aspx pages wchich are not concerned with session so there wont be any session related issues but are there some other issues? i am not getting how to call c# function from my asp page

A: 
i am not getting how to call c# function from my asp page 

You can't.

Mendy
Yes you can! :-)
Rune Grimstad
A: 

Have a look at this article. You can call static C# methods from asp.net.

PieterG
This uses a lot of JavaScript library that's embedded in ASP.NET pages, but you'd have to manually include it in a regular ASP page for it to work. Also, it's client side, which may not be desirable.
Thorarin
+5  A: 

The easiest way to do this would be to embed your C# code in a DLL and make it COM visible. That way you could call your code just as you would with any other COM library.

The other option is using web services, but that is slower and not easy to set up via classic ASP.

Rune Grimstad
plz can u explain how to do it as i am just unaware of it
Deepali
Place your c# into a C# Class Library project. Make the DLL COM visible -"Right click on the project In VS2005 and select "Properties". Under the "Application Tab" click the "Make assembly COM-Visible" checkbox. Then click on the "Build" tab and check the "Register for COM interop" checkbox in the "Output" section. Save."Build it, get the .dll that is created, add to your ASP website.
TheGeekYouNeed
One thing to note is that if your code is embedded in an asp.net page or site then you must extract the code into a separate project.
Rune Grimstad
hey thanx a lot
Deepali
A: 

This is a good article on the subject
Using-NET-Interops-in-VBScript

Terrance
Accepting any answers by chance?
Terrance