473,386 Members | 2,078 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,386 software developers and data experts.

using C# in a VB.Net project

I am using a 3rd party ecommerce application writen in VB.NET. I have
developed a couple c# addons that I would like to integrate into the
ecommerce site, more specifically I need to share session information across
the pages.

Can it be done?

Thanks, Justin.
Nov 18 '05 #1
3 1318
If you can have a aspx pages with vb.net code behind and aspx pages with c#
code behind within the same web application it is possible to share the
session. As it is the application context that holds the session
information. You need to try that.

But if you cannot have aspx vb.net and aspx c# run in the same web
applicationd then you won't be able to share the session in an other way
that doing it manually (request strings, DB, cookies maybe?).
But also check out also the option to run the storage of the Session
information out of process.
http://msdn.microsoft.com/library/de...sp12282000.asp
But I think that it may not help as if the pages run from different
applications they should not share the Session anyway. But as i never tried
the out process model, I am not sure. I am just trying to give you a few
hints for you to have a look at.

Best regards,

Francois

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
I am using a 3rd party ecommerce application writen in VB.NET. I have
developed a couple c# addons that I would like to integrate into the
ecommerce site, more specifically I need to share session information across the pages.

Can it be done?

Thanks, Justin.

Nov 18 '05 #2
Once compiled, a C# DLL is no different than a VB.Net DLL. As for
integrating your add-ons with a 3rd party application, I suppose that
depends on the add-ons and the 3rd party application. I can use the same
metal to build a car or a toaster. But try finding a plug in a car that you
can plug your toaster into!

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
I am using a 3rd party ecommerce application writen in VB.NET. I have
developed a couple c# addons that I would like to integrate into the
ecommerce site, more specifically I need to share session information across the pages.

Can it be done?

Thanks, Justin.

Nov 18 '05 #3
you'd need to put your C# code in a seperate project/assembly since you
can't have Both in the same project.

Now the problem is...the ASP.NET project is VB and the other project is a C#
Class Library. How do you get to all the good HTTP Stuff with C#?

In your C# project, make sure there's a reference to the System.Web
Namespace.
To get the HTTP stuff, try
System.Web.HttpContext ctx = System.Web.HttpContext.Current;

from there, you can get the ctx.Session, ctx.Response, ctx.Request
(of if you want to be REALLY cool...)
System.Web.Ui.Page thePage = (System.Web.Ui.Page)ctx.Handler;

If you want to cast the handler into your specific type of page, you're
going to have to have more than 2 projects...otherwise you'd end up with a
circular reference.

"Justin" <Ju****@discussions.microsoft.com> wrote in message
news:E4**********************************@microsof t.com...
I am using a 3rd party ecommerce application writen in VB.NET. I have
developed a couple c# addons that I would like to integrate into the
ecommerce site, more specifically I need to share session information across the pages.

Can it be done?

Thanks, Justin.

Nov 18 '05 #4

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

Similar topics

1
by: Jimmy Tran | last post by:
Hi Folks, I have a web database written in asp and using access97. I have many projects, but each project is being held responsible by a person. All people and projects come from the database....
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
5
by: Derek Martin | last post by:
I am creating a windows service and have added a reference to a DLL project that I have created. That DLL file is correctly referenced in both a windows app and a web app, all in the same...
2
by: Bill Nguyen | last post by:
I would like to add a new VB.NET project using the same folder being used by another project so that I can share several forms already creaded by the other project. However, .NET created a new...
1
by: Diffident | last post by:
Hello All, I have a question as to why my users are noticing error when I am building the project on the production system. Here is the problem's background. In order to build the project on...
8
by: Bruce | last post by:
I am using VB in Vs2005. Am I missing something or does VB not have the concept of "builds" (release/debug) like in VC? I wrote an assembly and I would like to have a debug version of the DLL...
12
by: BDowling | last post by:
Hi all, I have an existing Visual C++ project that builds a DLL (not COM or ATL or anything). I wish to use this DLL in a Visual Studio 2005 C# project without having to define each function and...
6
by: =?Utf-8?B?WW9naSBXYXRjaGVy?= | last post by:
Hello, I am using Visual Studio-2003. I created a project to build my library. Since I am using third party libraries as well, I have specified those additional library dependencies in project...
6
by: Daniel Kraft | last post by:
Hi all, in my C++ projects, I usually make "heavy use" of namespaces to "encapsulate" my code. When I have for instance something like this: namespace project { namespace part1 { ... }...
3
by: Jeff | last post by:
I have a solution with two projects. Project A is the startup project, while Project B serves as the project with the data logic. At run time, the first thing I need to do is write to Project...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.