0

I have a website (asp.net 4) with 49 pages. The website is in vb.

But I added a forum (and called it "knowledgbase"), so it's like ... company.com/knowledgebase/ ... I configured the forum as a separate application in IIS7, and it's written in c#.

Is it possible to use one of my vb master pages in the c# forum? Or would I have to create an entirely separate c# master page?

Edit:

Basically, in the knowledgebase/default.aspx file, there's this:

<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false"   
Inherits="YAF.ForumPageBase" culture="auto" uiculture="auto"  %>
<%@ Register TagPrefix="YAF" Assembly="YAF" Namespace="YAF" %>
<script runat="server">

I tried doing this:

<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" 
Inherits="YAF.ForumPageBase" culture="auto" uiculture="auto" 
MasterPageFile="~/homepage.Master"  %>
<%@ Register TagPrefix="YAF" Assembly="YAF" Namespace="YAF" %>
<script runat="server">

But of course ... the page language says "c#" and the master page is written in vb. So the result was this (as expected):

Server Error in '/knowledgebase' Application.
Parser Error 
Description: An error occurred during the parsing of a resource required to service 
this request. Please review the following specific parse error details and modify your 
source file appropriately.

Parser Error Message: The 'masterpagefile' attribute is not supported by the 
'register' directive.
Cœur
  • 37,241
  • 25
  • 195
  • 267
Jason Weber
  • 5,653
  • 6
  • 40
  • 73
  • 1
    Yes you can but you need to copy VB master page into `forum` webapp. – KV Prajapati Dec 11 '12 at 03:29
  • 1
    what have you tried so far? i think you can as long as it is on the same project – Patrick Guimalan Dec 11 '12 at 03:31
  • I'll update the question to say what I've tried ... – Jason Weber Dec 11 '12 at 03:44
  • 1
    Based on the error message, are you sure you put the `MasterPageFile` attribute in the `Page` directive? It's saying that you can't have that attribute in the `Register` directive. Are we missing some additional information? – TLS Dec 11 '12 at 04:02
  • Let me update it again, to be more accurate ... Thanks for trying to help, @TLS! – Jason Weber Dec 11 '12 at 04:11
  • 1
    check this http://stackoverflow.com/questions/1278024/mixing-c-sharp-vb-in-the-same-project – sicKo Dec 11 '12 at 08:30
  • Thank you ... I read through the info on the link you gave me, Sicko. But I think my case is different. All I'm trying to do is apply a master page, not "mix code" page by page. And as I mentioned, the /knowledgebase/ folder is designated as a separate application in IIS7. So I'm still looking into this. Thank you for taking the time to respond! – Jason Weber Dec 11 '12 at 22:26

0 Answers0