Mono Support VS 2008 WebPart Developmet - CodeFile Code Behind 

Viewed 21894 time(s), 5 post(s), 3/29/2011 7:54:20 AM - by peterg
3/29/2011 7:54:20 AM
246 Reputation 35 Total posts

Hi,

I am busy building a small webpart and i have noticed that my code differs from the code in the manuel

your reference
<%@ Control Language="C#" AutoEventWireup="true" Inherits="MonoSoftware.MonoX.Samples.HelloWorld" Codebehind="HelloWorld.ascx.cs" %>
when i build a page it looks like this:

<%@ Control Language="C#" AutoEventWireup="true" Inherits="MonoSoftware_MonoX_Samples_HelloWorld" CodeFile="HelloWorld.ascx.cs" %>

Note the Underscores from Inherit and the CodeBehind, sorry im not sure why this happens. Sorry it might be a very noob question.

Peter

1
3/29/2011 8:05:43 AM
246 Reputation 35 Total posts

Oh nevermind...it all has to do with if you open it as a website or as a project.....

now some of my goodies will work

2
3/29/2011 11:31:24 AM
15993 Reputation 2214 Total posts

Hi,

yes it is important to know which project type you have opened / created. There are two types of projects a "Web Site project" and "Web Application" (the one that MonoX uses - although you can use both in your custom solutions).

Here are some other useful resources:

Walkthrough: Converting a Web Site Project to a Web Application Project in Visual Studio
Converting a Web Site Project to a Web Application Project

Regards

3
3/29/2011 1:44:56 PM
7207 Reputation 956 Total posts

Yes, you have to use the Web application instead of the Web site project. Although both approaches have similar names, Web site project type is something totally different (no project files, very long compilation times, speicalized folders for application classes, etc) and MonoX does not support it.

4
3/29/2011 1:53:13 PM
246 Reputation 35 Total posts

Thanks,

Yes im sitting here arguing with VS to get a custom portal setup so i can then add Web App Pages and webparts rather than the website solution options....

ill get it done :)

Peter

5
This is a demo site for MonoX. Please visit Mono Software for more info.