473,322 Members | 1,494 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,322 software developers and data experts.

user control in C#,web page in VB

hi,

Im a newbie.I was wondering if I can include user controls written in C# in
a web page that uses Vb.net for its code behind?Since all code gets compiled
to MSIL i feel it should be possible I think.

Thanks in advance for your replies.

cooltech77
Nov 19 '05 #1
4 1320
The .NET framework supports this but Visual Studio 2003 and before do not
support mixing languages within a project.
Visual Studio 2005 does permit this, however.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
hi,

Im a newbie.I was wondering if I can include user controls written in C#
in
a web page that uses Vb.net for its code behind?Since all code gets
compiled
to MSIL i feel it should be possible I think.

Thanks in advance for your replies.

cooltech77

Nov 19 '05 #2
Thanks!
That helped.

cooltech77

"Steve C. Orr [MVP, MCSD]" wrote:
The .NET framework supports this but Visual Studio 2003 and before do not
support mixing languages within a project.
Visual Studio 2005 does permit this, however.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
hi,

Im a newbie.I was wondering if I can include user controls written in C#
in
a web page that uses Vb.net for its code behind?Since all code gets
compiled
to MSIL i feel it should be possible I think.

Thanks in advance for your replies.

cooltech77


Nov 19 '05 #3
yes. with a few tricks.

1) don't use a code behind
2) use a seperate project, and copy the dll and ascx to the current project
3) create a seperate proj for the c# codebehind, which you include in the
solution, and add the ascx to the current project.

-- bruce (sqlwork.com)

"cooltech77" <co********@discussions.microsoft.com> wrote in message
news:67**********************************@microsof t.com...
hi,

Im a newbie.I was wondering if I can include user controls written in C#
in
a web page that uses Vb.net for its code behind?Since all code gets
compiled
to MSIL i feel it should be possible I think.

Thanks in advance for your replies.

cooltech77

Nov 19 '05 #4
Bruce Barker wrote:
yes. with a few tricks.

1) don't use a code behind
2) use a seperate project, and copy the dll and ascx to the current
project 3) create a seperate proj for the c# codebehind, which you
include in the solution, and add the ascx to the current project.


Be careful using option 1 as it may cause you to suffer from fragmentation.
Inline ASP.NET pages are not batched and if you have a lot of them, you can
end up with a lot of small assemblies in memory. If you have enough of
them, you can end up with an OutOfMemoryException due to fragmentation.

--
Jim Cheshire
JIMCO Software
http://www.jimcosoftware.com

FrontPage add-ins for FrontPage 2000 - 2003


Nov 19 '05 #5

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

Similar topics

6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
6
by: grist2mill | last post by:
I want to create a standard tool bar that appears on all pages that is a control. The toolbar has a button 'New'. What I wolud like when the user clicks on 'New' depends on the page they are on. I...
5
by: Steve Richter | last post by:
In my user control I want to read the ViewState dictionary of the Parent control. But this sensible idea is not permitted by the compiler: Compiler Error Message: CS1540: Cannot access...
6
by: Steve Booth | last post by:
I have a web form with a button and a placeholder, the button adds a user control to the placeholder (and removes any existing controls). The user control contains a single button. I have done all...
7
by: Smithers | last post by:
I have a non trivial ASP.NET Web application that implements its navigation system via a user control (menu.ascx) placed on every page. It is important to note that the user control that hosts...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
2
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
4
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.