I have an existing VB.NET web project that requires some new screens (webforms). Due to a number of reasons these new screens are to be developed in C#. Having had a read around it appears that this is indeed possible: Adding C# Web Form to VB Web Application and add c# user control to existing asp.net vb.net project
However I have done a small test of:
- VB.NET Solution containing a VB WebForms application project
- Added a new C# ASP.NET Project to the solution
- Created web user control in C# assembly
- Referenced and used web user control in a Default.aspx in 1.
Problem is the user control does not display on the page. What have I missed here. Is this something that is not possible in a VB.NET WebForms app? Below is the relevant code:
Default.aspx
<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="waWithCUserControl._Default" %>
<%@ Register TagPrefix="uac" Namespace="waUserControls" Assembly="waUserControls" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<uac:UcTakeTest ID="myUserControl" runat="server" />
</asp:Content>
User Control In Seperate Assembly waUserControls
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucTakeTest.ascx.cs" Inherits="waUserControls.UcTakeTest" %>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" rel="stylesheet">
<div class="container">
<div class="row">
<div class="col-md-2">
<div class="list-group">
<a href="#" class="list-group-item active">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
<a href="#" class="list-group-item">Question</a>
</div>
</div>
</div>
</div>