Mono Support Polls: How to configure polls and Apply CSS like on Page 66 of Documentation (Closed)

Viewed 142891 time(s), 28 post(s), 7/15/2011 12:24:25 AM - by yousaid
7/28/2011 7:49:08 AM
15993 Reputation 2214 Total posts

Hi,

yes we are using the WAP model, WPI installation isn't related to having designer files or not, it installs the compiled MonoX CMS which does't contain any designer files because they are compiled in the assembly. So if you create your own project (solution) that is based on the Web site model then you don't get designer file creating because they are created on the fly by the framework. I suppose you are using the Web site model so we will test this issue on that model too and get back to you.

Regards

21
7/28/2011 9:03:05 AM
3016 Reputation 428 Total posts

Hi,

I have just downloaded the latest MonoX using WPI, opened it as a web site, added new user control, copied your code within it, built and got an error because CodeFile property in markup was not set properly.

Before:

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

After:

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

Let us now if everything is ok now,

Regards.

22
7/29/2011 2:58:31 PM
206 Reputation 36 Total posts

Greetings,
Well, unfortunately, your changes don't work. After applying your changes, and recompiling the the site, when you attempt to lunch the WebParts catalog, you get this Exception
Image #1 and the webparts catelog will not even Load.

Your Code: Will not compile and throws the exception in Image #1

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


My Changes to your code: notice the /. Compiles but theows the exception in Image #2
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="/MonoX/ModuleGallery/Pollmaster.ascx.cs" Inherits="MonoX_ModuleGallery_Pollmaster" %>

Question:
Are you able to get any poll to load with your code? If yes, can you post the code?cheers,
yousaid

23
7/29/2011 8:59:15 PM
15993 Reputation 2214 Total posts

Hi,

in any case when we have provided you with the code it was tested and it was working properly on our side, as you have issue with all of the samples we have provided you with is it possible to schedule a TeamViewer session related to this issue so we can check and fix everything on your side ?

Let us know if this suites you.

Regards

24
7/29/2011 9:18:41 PM
206 Reputation 36 Total posts

Greeetings,
Pick a time that works for you.
cheers,
yousaid

25
7/29/2011 9:33:33 PM
15993 Reputation 2214 Total posts

Hi,

does the 02.08 around the 3-5pm works for you ?

Regards

26
7/29/2011 9:44:24 PM
206 Reputation 36 Total posts

Perfect.
till then.
cheers,
yousaid

27
8/18/2011 11:15:45 AM
15993 Reputation 2214 Total posts

Hi,

  sorry for the delay I didn't forget about this issue but I was very busy these days. I have found the "thing" that is causing the error and it is related to Web site Project and WAP co-operation.

If you inherit UserControl / WebPart that is build on top of the WAP and you are using the Web site project type the ASP.NET has an issue related to building the control tree so that's why we don't get the control instances - they are all null.

Basically this issue is related to ASP.NET AutoEventWireup functionality and when you turn this on (and it is turned on by default)  then Web site (for some unknown reason) overrides the WAP control tree generation and controls are not instantiated. Dirty fix that I have found is to disable this functionality in case of the Web site project type so you can use the inherited WebPart (Note: at this point I didn't find issues that you may face using this fix but I'm not sure that they won't arise later on). Don' forget that If you disable the AutoEventWireup then you need to override the events such as Page_Load (OnLoad) etc.

To implement dirty fix change the below code from:

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

To:
<%@ Control Language="C#" AutoEventWireup="false" CodeFile="Pollmaster.ascx.cs" Inherits="MonoX_ModuleGallery_Pollmaster" %>

I hope that this will work for you, please let us know if you need any further information.

Regards

28
1 2 3
This is a demo site for MonoX. Please visit Mono Software for more info.