Deploying user control from c# to vb

R

R Dorris

I'm sure this has been answered many times, but can someone point me to some
documentation? I've created a user control in C# and would now like to hand
it to someone for deployment in an asp.net vb project. I have compiled the
control and given the other developer the .ascx file and the .dll. What steps
does the developer need to take to use the control? What does he need to do
so that he can access the control from the code-behind page? btw, the user
control was built using code-behind. thanks.
 
T

Teemu Keiski

Hi,

add ascx to the project, and take reference to the dll of the ascx. and then
make sure ascx refers to this code-behind class (or a class derived from it
if developer needs to plug something to it)
 
R

R Dorris

I noticed that when i added the ascx file to the vb project, it changed the
language tag to "VB". I changed that back to "C#". Also, I removed the
codebehind tag since the cs file is not part of the vb project. Was this
correct?

Also, to get a reference in the vb codebehind, I had to do a
Page.FindControl()... is that the best way to get a reference to the control?

thanks.
 
S

Steve C. Orr [MVP, MCSD]

User controls are not meant to be shared between projects.
And, if you're using Visual Studio 2002 or 2003, you can only have one
language per project. (Visual Studio 2005 doesn't have that limitation.)
If you wanted to do this kind of sharing you really should have created a
custom control instead of a user control.

Here's more info:
http://SteveOrr.net/faq/UserCustom.aspx
 
R

R Dorris

That's sure not what the documentation states :) The docs make reference to
sharing user controls between applications -- written in different languages
-- but never explains in detail how to do that. I agree, my control should be
written as a custom control, but I was emphasizing the R in RAD! Thanks for
the reply.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top