CSSAdapters and MOSS 2007, how to get it done?

Rate It (1)

Last post 04-09-2007 5:53 PM by mossman. 11 replies.

Sort Posts:

  • CSSAdapters and MOSS 2007, how to get it done?

    10-23-2006, 7:21 PM
    • Member
      150 point Member
    • bernadou
    • Member since 12-30-2005, 11:34 PM
    • Posts 32

    We have been experimenting with MOSS 2007 as a CMS for our organization.  As an educational organization subject to 508 compliance, our front end web designers/developers have specfied that we need to get the CSSAdapters implemented on the Shareponint navigation controls so they can go nuts with CSS. 

    We found this article http://blogs.tamtam.nl/frank/ , so, myself and one other person here in our organization have been struggling with getting it to work on a regular asp.net menu control, but using an assembly instead of the .VB source code files (we can get it to work with .vb code files to work without issue).

    So, here is what we have done that does work well…

    1. Dowloaded and installed the CSS Friendly ASP.NET 2.0 Control Adapters code from MS.
    2. As discussed in the article, we created a new web app using the , and, added a class library which included all the adapter code files and we compiled to a signed assembly named: CSSAdapters.dll.
    3. We registered the assembly to the GAC, and, can verify that it exists (c:\windows\assembly\cssAdapters)

    Here’s where we ran into trouble…

    We moved the CssAdapter.browser file, into C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers and edited it to look for our assembly in the GAC:

    <adapter controlType="System.Web.UI.WebControls.Menu"
                   
    adapterType="CSSFriendly.MenuAdapter, CssAdapters, 
                                        
    version=1.0.0.0, 
                                        
    Culture=neutral, 
                                        
    PublicKeyToken=<The Token>"/>

    We attempted to register the adapter at the machine level by running aspnet_regbrowsers.exe but got a “Cannot Load Type CSSFriendly.MenuAdapter” error.

    As you can imagine, we’ve done all kinds of testing and we’ve verified…

    We can use CSSAdapters.DLL when placed in the BIN of a local test site in combination with the local .browser file configured like this:

    <adapter controlType="System.Web.UI.WebControls.Menu"
                   
    adapterType="CSSAdapters.CSSFriendly.MenuAdapter, CssAdapters"/>

    So, this tells us that the .dll is good, and, all the associated code is good (right?).

    We think our error is getting ASP.NET to play nice with the machine level so when we try to move all this over to the MOSS 2007 it will pick it up.  I don’t think that is possible if we try to just drop the App_Code and App_Browser files over into the root dir of the MOSS installation (right?).

    I think if we can get the support of the ASP.NET community in working through this problem, this could be a huge help to others that come along later.

    Thanks for any assistance you can offer.

    Bernie

  • Re: CSSAdapters and MOSS 2007, how to get it done?

    10-26-2006, 3:03 PM
    • Member
      150 point Member
    • bernadou
    • Member since 12-30-2005, 11:34 PM
    • Posts 32

    Ok, we found the errors both in our work, and in the article.  By working through both we were able to get SharePoint to render the Menu control as a list instead of a table.  Very cool.

     If you happen to be one of those who wish to try this be sure you....

    1. Change the syntax below from "ControlAdapters" to "CSSAdapters" (assuming your assembly is called CSSAdapters which was our case)

    <browsers>
       <browserrefID="Default">
          <controlAdapters>
             <adapter controlType="System.Web.UI.WebControls.Menu"
                   adapterType="CSSFriendly.MenuAdapter, ControlAdapters, 
                                        version=1.0.0.0, 
                                        Culture=neutral, 
                                        PublicKeyToken=<Your Token>"/>
          </controlAdapters>
       </browser>
    </browsers>

    2. Rember that the article appears to be operating under the assumption that you are performing the outlined steps on the same server that you have SharePoint installed.  If not, repeat the GAC install and aspnet_regbrowsers.exe on your SharePoint server(s).

    If you follow these two recommendations, it should work!  Good Luck.

     

    B

  • Re: CSSAdapters and MOSS 2007, how to get it done?

    11-16-2006, 4:52 PM
    • Member
      20 point Member
    • anabhra
    • Member since 11-16-2006, 9:50 PM
    • Posts 4
    I am farily new to this stuff...would it be asking for too much if I ask you to post your code?
  • Re: CSSAdapters and MOSS 2007, how to get it done?

    11-16-2006, 4:57 PM
    • Member
      150 point Member
    • bernadou
    • Member since 12-30-2005, 11:34 PM
    • Posts 32

    We didn't write any specific code of our own to get this to work.  We just followed the article I noted (http://blogs.tamtam.nl/frank/) using the CSS adapter code you can download here:

    http://www.asp.net/CSSAdapters/Default.aspx

    Good luck! LMK if you have any more questions.

     

    B

  • Re: CSSAdapters and MOSS 2007, how to get it done?

    11-17-2006, 3:06 PM
    • Member
      20 point Member
    • anabhra
    • Member since 11-16-2006, 9:50 PM
    • Posts 4
    I think i am on the right track now. You are right all one has to do is drop the adapter class in the bin folder and setup the .browser file. One thing I am experiencing is that when I drop the new .browser file the old compat.browser starts to give errors with nokia or samsung devices. I got rid of the file but guess I need to bring it back in after some research!! Thanks fo ryour help, regards, anabhra
  • Re: CSSAdapters and MOSS 2007, how to get it done?

    11-20-2006, 12:27 PM
    • Member
      5 point Member
    • aakashuk
    • Member since 11-20-2006, 5:22 PM
    • London
    • Posts 1

    Working with Navigation Control in MOSS 2007

     

    I am working on MOSS navigation for couple of days and I faced lots of issue which I resolve and it took lot of my time and I don’t want every one do go through this all time consuming process.

     

    Scenario:

    As you know all control in MOSS is render as TABLE and when you working in Government project it have become pretty obvious that all the SharePoint control should be rendered as CSS styling. As you know Microsoft has come with CSS Adapter for some of the ASP.NET 2.0 control like TreeView, Menu  etc so that it can be rendered as CSS.I will show step wise instruction how you can modify a SPTreeControl of SharePoint and apply CSS Adapter into it.

     

    I will post the url where I have uploaded the pdf document about this Issue and how I resolved in my Project.

    Shambhu Kumar
    Parity Ltd.
    Wimbledon
    London
  • Re: CSSAdapters and MOSS 2007, how to get it done?

    11-22-2006, 4:34 PM
    • Member
      20 point Member
    • anabhra
    • Member since 11-16-2006, 9:50 PM
    • Posts 4
    I have been able to implement the css adapters too. My problem though is the "selected" item setting. After I click on a menu item and the page is refreshed, it does not seem to retain the selected setting. Is there a way to debug the modified adapter code? thanks, anabhra
  • Re: CSSAdapters and MOSS 2007, how to get it done?

    01-19-2007, 7:18 AM
    • Member
      4 point Member
    • Troels
    • Member since 01-19-2007, 12:15 PM
    • Posts 3
    I've tried this for 2 days now and i cant get it to work. Sharepoint keeps giving an error message "File Not Found" when i enable the browsers file. If i remove the reference to my assembly everything works. I've placed the assembly in the GAC and the various bin folders and the source in the app_code folder and yet i keep getting this error. Do tou have any suggestions that might help?
  • Re: CSSAdapters and MOSS 2007, how to get it done?

    01-19-2007, 8:47 AM
    • Member
      4 point Member
    • Troels
    • Member since 01-19-2007, 12:15 PM
    • Posts 3
    Note to self: When Sharepoint gives error "File Not Found", check if classes are declared as "Public".Super AngryBig Smile
  • Re: CSSAdapters and MOSS 2007, how to get it done?

    02-23-2007, 6:35 PM
    • Member
      150 point Member
    • bernadou
    • Member since 12-30-2005, 11:34 PM
    • Posts 32

    Our solution to this problem was to find the web.config file that SP copies to your provisioned site (c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG\compat.browser).  Comment out these lines (You'll need to do this on the compat.browsers file in your newly created SP site in IIS too):

    <!--
        <browser id="InfrawareSamSung" parentID="SKTDevicesSamSung">
            <identification>
                <userAgent name="browserType" match="(35|15|25)" />
            </identification>
            <capabilities>
                <capability name="canInitiateVoiceCall"                 value="True" />
                <capability name="cookies"                              value="True" />
                <capability name="isColor"                              value="True" />
                <capability name="optimumPageWeight"                    value="700" />
                <capability name="preferredRenderingMime"               value="text/vnd.wap.wml" />
                <capability name="preferredRenderingType"               value="wml12" />
                <capability name="rendersBreaksAfterWmlInput"           value="True" />
                <capability name="rendersWmlSelectsAsMenuCards"         value="True" />
                <capability name="requiresFullyQualifiedRedirectUrl"    value="True" />
                <capability name="supportsEmptyStringInCookieValue"     value="False" />
                <capability name="preferredRequestEncoding"             value="ks_c_5601-1987" />
                <capability name="preferredResponseEncoding"            value="ks_c_5601-1987" />
            </capabilities>
        </browser>

        <browser id="InfrawareLG" parentID="SKTDevicesLG">
            <identification>
                <userAgent name="browserType" match="(35|15|25)" />
            </identification>
            <capabilities>
                <capability name="canInitiateVoiceCall"                 value="True" />
                <capability name="cookies"                              value="True" />
                <capability name="isColor"                              value="True" />
                <capability name="optimumPageWeight"                    value="700" />
                <capability name="preferredRenderingMime"               value="text/vnd.wap.wml" />
                <capability name="preferredRenderingType"               value="wml12" />
                <capability name="rendersBreaksAfterWmlInput"           value="True" />
                <capability name="rendersWmlSelectsAsMenuCards"         value="True" />
                <capability name="requiresFullyQualifiedRedirectUrl"    value="True" />
                <capability name="supportsEmptyStringInCookieValue"     value="False" />
                <capability name="preferredRequestEncoding"             value="ks_c_5601-1987" />
                <capability name="preferredResponseEncoding"            value="ks_c_5601-1987" />
            </capabilities>
        </browser>

        <browser id="InfrawareSKY" parentID="SKTDevicesSKTT">
            <identification>
                <userAgent name="browserType" match="(35|15|25)" />
            </identification>
            <capabilities>
                <capability name="canInitiateVoiceCall"                 value="True" />
                <capability name="cookies"                              value="True" />
                <capability name="isColor"                              value="True" />
                <capability name="optimumPageWeight"                    value="700" />
                <capability name="preferredRenderingMime"               value="text/vnd.wap.wml" />
                <capability name="preferredRenderingType"               value="wml12" />
                <capability name="rendersBreaksAfterWmlInput"           value="True" />
                <capability name="rendersWmlSelectsAsMenuCards"         value="True" />
                <capability name="requiresFullyQualifiedRedirectUrl"    value="True" />
                <capability name="supportsEmptyStringInCookieValue"     value="False" />
                <capability name="preferredRequestEncoding"             value="ks_c_5601-1987" />
                <capability name="preferredResponseEncoding"            value="ks_c_5601-1987" />
            </capabilities>
        </browser>

        <browser id="InfrawareMotorola" parentID="SKTDevicesMotorola">
            <identification>
                <userAgent name="browserType" match="(35|15|25)" />
            </identification>
            <capabilities>
                <capability name="canInitiateVoiceCall"                 value="True" />
                <capability name="cookies"                              value="True" />
                <capability name="isColor"                              value="True" />
                <capability name="optimumPageWeight"                    value="700" />
                <capability name="preferredRenderingMime"               value="text/vnd.wap.wml" />
                <capability name="preferredRenderingType"               value="wml12" />
                <capability name="rendersBreaksAfterWmlInput"           value="True" />
                <capability name="rendersWmlSelectsAsMenuCards"         value="True" />
                <capability name="requiresFullyQualifiedRedirectUrl"    value="True" />
                <capability name="supportsEmptyStringInCookieValue"     value="False" />
                <capability name="preferredRequestEncoding"             value="ks_c_5601-1987" />
                <capability name="preferredResponseEncoding"            value="ks_c_5601-1987" />
            </capabilities>
        </browser>
    --> 

    This will then provision all your future sites without the offending entries.  I 'think' this is only used to change the rendering behavior based on the type of browser used to create the http request.

    Hope this helps.

    B

  • Re: CSSAdapters and MOSS 2007, how to get it done?

    04-06-2007, 7:40 PM
    • Member
      2 point Member
    • rcalmann
    • Member since 04-05-2007, 11:10 PM
    • Posts 1

    I have the same problem, the menu code never finds any of the items as selected.

    You can debug by build the code into a DLL, put it in the app_bin folder, modify the browser file as:

    <adapter controlType="System.Web.UI.WebControls.Menu" adapterType="CSSFriendly.MenuAdapter, CssAdapters"/>

    where: adapterType = Namespace.Classname, AssemblyName

    Good luck

  • Re: CSSAdapters and MOSS 2007, how to get it done?

    04-09-2007, 5:53 PM
    • Member
      22 point Member
    • mossman
    • Member since 03-07-2007, 5:18 PM
    • Posts 10

    Here's an article a friend of mine wrote on getting them to work in a publishing site. Be forewarned that there are issues with the treeview and the admin interfaces.

    http://www.sharepointblogs.com/mossman/archive/2007/03/08/css-friendly-control-adapters-in-sharepoint-2007-a-walk-through.aspx

Page 1 of 1 (12 items)