CSS Adapters effecing other controls?

I'm using the css adapters to style the menu. It works fine.

BUT: in other parts of the site, in pages without any css-friendly related stuff, menus and gridviews look wierd. Totaly different from
the way they used to be before I added the css friendly adapters. I'm almost sure there is a connection.

How can I make sure that a specific menu is NOT affected by the adapters?

Thanks,
Gili

 

0
gili
4/11/2007 10:41:08 PM
asp.net.css-control-adapters 905 articles. 0 followers. Follow

4 Replies
612 Views

Similar Articles

[PageSpeed] 17

I found this on the CSS Friendly adapters website whitepage: 

Disabling Adapters

If you explicitly add AdapterEnabled="false" to your server-side tag, these sample adapters will attempt to use the ASP.NET framework's native rendering for the control. Beware: this is not supported and often does not work well. Fundamentally, the framework does not support disabling adapters on a per control basis. The AdapterEnabled attribute is only intended to be used experimentally.
 

That is a very explicit way to block the adapters, or you could also delete unused adapters definitions from the CSSFriendlyAdapters.browser file.  For my website I use only the menu adapters so the CSSFriendlyAdapters.browser file looks like:

<browsers>
<browser refID="Default">
<controlAdapters>
<adapter controlType="System.Web.UI.WebControls.Menu" adapterType="CSSFriendly.MenuAdapter" />
</controlAdapters>
</browser>

<browser id="W3C_Validator" parentID="default">
<identification>
<userAgent match="^W3C_Validator" />
</identification>
<capabilities>
<capability name="browser" value="W3C Validator" />
<capability name="ecmaScriptVersion" value="1.2" />
<capability name="javascript" value="true" />
<capability name="supportsCss" value="true" />
<capability name="supportsCallback" value="true" />
<capability name="tables" value="true" />
<capability name="tagWriter" value="System.Web.UI.HtmlTextWriter" />
<capability name="w3cdomversion" value="1.0" />
</capabilities>
</browser>
</browsers>
  I hope this helps!



Don't forget to click "Mark as Answer" on the post that helped you.
This marks your thread as Resolved so we will all know you have been helped.
0
benderm
4/12/2007 7:24:37 AM

You can also make your own subclass of the Menu control, then apply the CSS adapters only to that control.

Create your control:

namespace MyControls {
    public class CssMenu : System.Web.UI.WebControls.Menu {
        ...
    }
}

Then set your .browser file:

<controlAdapters>
    <adapter controlType="MyControls.CssMenu"
             adapterType="CSSFriendly.MenuAdapter" />
</controlAdapters>
  
- brian
- blog: www.sidesofmarch.com
0
bdemarzo
4/12/2007 1:08:40 PM

Thanks, Brian, that sounds like the perfect solution: keep my good old menu, gridview, etc', and have a css-adapted version too.

Only 2 quick questions, as I'm not familiar with subclassing:
1. inside the inherited class, do I have to write anything, or is it just in order to distinguish between the two versions?
2. After I did that, what do I write in my aspx page? I mean, instead of <asp:menu.... > what will come?

Thanks,

Gili

0
gili
4/13/2007 1:53:32 PM
  1. You only need a default constructor. Be sure to call the base() constructor: public void MyMenu() : base()
  2. Register the control like you would any other server control and add it accordingly. That is...
    <%@ Register TagPrefix="myControls" ... %>
    ...
    <myControls:MyMenu ... >


- brian
- blog: www.sidesofmarch.com
0
bdemarzo
4/13/2007 2:17:51 PM
Reply:

Similar Artilces:

Is CSS Control Adapters compatible with WebPart and WebPartZone controls?
Both WebPart and WebPartZone ultimately derive from WebControl, so it seems like this would work, but before I got into it deeply, was curious if anyone had tried it and if there are any issues? I don't think there is an esay way to make it works. This was a reply from Scott Guthrie: Unfortunately I don't think there is a super easy way to override WebParts -- since some of the layout does assume tables (since the CSS to-do this positioning with divs isn't super easy).  We are going to look at whether it is possible to build another control adapter for webparts in the f...

Reagrding using FILTER in (MenuExample.css) CSS adapter classes for Menu control
Hello everyone, Whenever I use filter: in any of the CSS calss for the MENU control using CSS adapters, it only renders the first level of the menu, all subsequent levels are not even displayed. I want to use filter for some transparency effect, but using it is not rendering any child menu's. Following is a example - .PrettyMenu .AspNet-Menu-Vertical { position:absolute; top: 87px; left: 0px; width:200px; z-index: 300; filter:alpha(Opacity=50); } Now it only shows first level and rest of the menus are not displayed, if I remove filter, it works fine but without transparency. Rep...

CSS Control Adapters
I was thinking to implement menu like on www.auctiva.com using CSS Control Adapters. How would I do it?The enu would have two bars:1) Main bar - tabs 2 Second bar with submenu items, all links horizontallyRafal Zikbay.com - Free Classifieds (Search Over 5 mln jobs on Zikbay.com) DNN Direct Anybody can help?Rafal Zikbay.com - Free Classifieds (Search Over 5 mln jobs on Zikbay.com) DNN Direct ...

CSS control adapters
I've just seen another thread mentioning these which reminded me that I couldn't install the blighters. A couple of questions first tho.  The VSI file that I download won't load/install, it comes up with "string cannot have zero length".  ANybody any ideas on what may be going wrong? Second question is on how these get deployed on my remote server, will I be able to use them without access to the core asp library directories (if that makes sense). To fix the VSI installer problem, see this posting, http://forums.asp.net/thread/1492405.aspx. To deploy the adapters you do not ...

Trouble controlling .net controlls with CSS
 I am trying to control the :hover css property on <asp: Button> controls. Basically the css is working correctly to set the initial look of the button, but nothing is happening when I hover over the button. Here is my code:CSS:.sidebarButton{    width: 168px;     height: 45px;     background-color: #666666;     text-align: left;    font-weight: bold;    font-family: Century Gothic;    font-size: 13pt;    color: White;    border-style: none;  ...

CSS Control Adapter for Gridview
I am tryin to style a gridview.My site is using CSS Friendly control adapter. I am new to this. Can u guys pls help me make the gridview look better. Every time i add a div tag,i get an error that div is not a property of the gridview.If i put it to envelope the gridview, nothin happens!! Thanks.  If you left the (ID) of the GridView as GridView1 then you should be able to find <div class="AspNet-GridView" id="GridView1"> in the source when you run the page.   You can use the class to style the GridView.  You should also be able to find ot...

CSS Control Adapters #2
HiI have downloaded the CSS adapters from http://www.asp.net/cssadapters/, but how do I tell the menu to use the CSS? Cheers  Check this link http://www.asp.net/CSSAdapters/Default.aspx check the tab, "Help" -> "Tutorials" Another Link http://weblogs.asp.net/scottgu/archive/2006/05/02/CSS-Control-Adapter-Toolkit-for-ASP.NET-2.0-.aspxblog.budigelli.com Hey bopo, Ravi...Is totally right but sometimes a simple answer can really help. Once you have added the neccesary files to your project, in source view add (CssSelectorClass="PrettyMenu"&n...

CSS Unfriendly Control Adapters
I don't find these  so-called CSS friendly adapters. I'm very good using css, but I'm like working in design view the most so I can see my design as I create sites. However, design view is useless when using these controls.  I'm having extreme difficulties when using Ajax also. Am I wrong, or is it just that I'm using Visual Studio 2008 Pro to develop sites using asp.net 3.5?I just purchased VS Pro with a MSDN Subscription and paid about $3500. What a disapointment that the native controls adds everything in tables, and the CSS Friendly Controls are difficult to...

TreeView and CSS Control Adapters
Hello All,I am using CSS control Adapter for my TreeView. The Intention is to emit <ul> and <li> tags instead of tables.But I am getting this error************************************************************************************** **************************************************************************************Server Error in 'xyz' Application. The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Description: An unhandled exception occurred during the execution...

Excluding control from CSS Adapter
I use menu in two places in the website: Main menu and User Menu. While I want to use CSS Adapter for Main menu, I do not want to use CSS Adapters for USer menu. It is the same tag in both places: asp:menu. Please helpRafal Zikbay.com - Free Classifieds (Search Over 5 mln jobs on Zikbay.com) DNN Direct  According to this book:  "...once you set up your adapters to run in your project, there is no real way to turn them off. It's not as if you can say "okay, GridView1, you use the adapters. But GridView2? No way; I want to style you myself" If they are on, t...

Menu Css Control Adapter
  Hi everybody, i have been working with menu css control adapter of .net 2.0, but i'm having some troubles to use it. I have a vertical menu and in forward of the menu i have a swf file (Flash). what happens is that the menu it appears in the back of the swf file and it's menu subitems is  unreachable.   How can i fix it???? Please Someone ...... Thanks in advanced... I had the same problem with my menu not displaying from my master page over the top of image in the content place holder, i got around this by putting the menu and the content in DIV with the correct Z-...

Wizard Control and CSS Adapters
Has anyone dealt with the wizard control and CSS Adapters?  I tried to create one myself, but it seems to mess with the datalist adapter already in place. If anyone has any thoughts or suggestions, that would be greatly appreciated. Thanks, Nichole...

ChangePassword control and CSS Friendly Adapters
 Hi, I have difficulty getting ChangePassword control to work properly, ie, user enters correct current password and valid new password, new password is updated in DB but control shows error. I appreciate that this error is caused by double postback and have read threads such as http://forums.asp.net/p/1100637/1672132.aspx detailing the solutions. How can I go about implementing the code in the above-mentioned thread? Where should I place them?  Thanks. Hi You may contact steve harman by a private email for help, However, try to use MembershipUser.ChangePass...

How do I use CSS Friendly Control Adapters
I’ve been reading a lot on the CSS Friendly Control Adapters and I getting a lot of conflicting and confusing information.   There seems to be two approaches to the use of these which appears to derives from there being two implementations. An older version which involved running a vsi file which I can’t seem to find in the package. And a later method which seems to only involve adding a refrence to the dll file and adding a App_Browsers folder and placing the CSSFriendlyAdapters.browser file in the folder.  Here’s an example, I’m looking at a page from this site, “ASP.NET 2.0 ...

Web resources about - CSS Adapters effecing other controls? - asp.net.css-control-adapters

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Home lost after out-of-control grassfire at Edgecombe in central Victoria
One home is lost after a fast-moving grassfire sweeps through Edgecombe in central Victoria..

Apple’s iOS 9.3 preview page hints at possible Control Center toggle to enable Night Shift
... If you head to the iOS 9.3 preview page on Apple Canada’s website , you can see that there’s an option to enable Night Shift from Control Center ...

New Night Shift mode in iOS 9.3 could have its own Control Center toggle
In all likelihood, youll be able to toggle the new Night Shift mode in iOS 9.3 right from Control Center. It came from Canada At least thats ...

Contextual and Granular Notification Controls
... written a lot about notifications, at one point calling the notifications screen “my home screen.” But I don’t like how we are forced to control ...

US Democratic debate: Candidates spar on gun control
Candidates in the Democratic race for the White House hold their liveliest TV debate yet, clashing over gun control and healthcare among other ...

Doro PDF printer adds color conversion, page rotation controls
Lightweight virtual PDF printer Doro has been updated with new color conversion and page rotation settings. If the default "UseDeviceIndependentColor" ...

Cruz control: take a look at his puppet master
Cruz control by digby If you read nothing else today, read this Bloomberg article about Ted Cruz's top benefactor, the certifiably looney tunes ...

AlunaGeorge share "I'm In Control" ft. Popcaan
... last year to preview material off the followup to their 2013 debut Body Music, and now the first single is here. It's called "I'm In Control" ...

A guy made a remote control airplane using the fan from an old wall heater
... and old heater in his house when he realized that the blower motor inside of it could work a lot like a jet engine — so he made a remote control ...

Resources last updated: 1/21/2016 6:42:43 AM