Reputation: 910
i have written an asp.net user control in vb.net. now i have a c# web application that i need to use this control in, is there some way to export this user control into a dll or something to be able to resuse it
Upvotes: 1
Views: 1221
Reputation: 63065
You better move your shared controls to vb.net web application project, then you can reuse that in both vb.net projects and c# projects
Steps:
copy "$(SolutionDir)SharedControl\*.ascx" "$(ProjectDir)Controls\"
ASPX
<%@ Register Src="~/Controls/WebUserControl1.ascx" TagPrefix="uc1" TagName="WebUserControl1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<uc1:WebUserControl1 runat="server" ID="WebUserControl1" />
Upvotes: 1
Reputation: 5806
Publish your vb.net project to some folder. That will generate dll. Drop that dll to your c# project's bin. Drop ascx control to some folder in your c# project. Register tag prefix and you are done.
Upvotes: 0