Toggle Button, ToolKit CSS, CSS Adapters

First: There is no real point to this message, it's just me ranting about something that annoyed me in the samples online. All in all I think the teams working on and css are doing a splendid job, and Atlas works well in most cases, and for most needs. However, my rent is more about some whining about details. 

Now, here is something that sort of just irked me.

The same folks who do AJAX.NET are the same folks who are doing CSS adapters. (assuming I am not mistaken on that). In any case, the image flickering on a small demo such as the ToggleButton is simply terrible:

Now, don't get me wrong, I am using ATLAS/AJAX.NET quite a bit for many things. I have also used (tried to use) the CSS Adapter kit on several things.

in the end, this control also seems like its a waste of time. It makes a nice sample I suppose.  But what the heck is all this for.... I mean, the "effect" is to change the image. The click might be the post back being ajaxified. But why even bother setting this sample up.

Sys.Application.add_init(function() {
    $create(AjaxControlToolkit.ToggleButtonBehavior, {"CheckedImageAlternateText":"Check","CheckedImageUrl":"ToggleButton_Checked.gif","id":"ctl00_ContentPlaceHolder1_ToggleButtonExtender1","ImageHeight":19,"ImageWidth":19,"UncheckedImageAlternateText":"UnCheck","UncheckedImageUrl":"ToggleButton_Unchecked.gif"}, null, null, $get("ctl00_ContentPlaceHolder1_CheckBox1"));

Here is what my custom button with mouseover outputs...

(the method ci sits in a js file downloaded once, that simply does the src change)

<input type="image" id="ctl00_imgBtn1" onMouseOver="ci(this,'/images/template/but_home_hover.gif');" onMouseOut="ci(this,'/images/template/but_home.gif');" src="" />

The end result is the same, but if I need 200 images on a page, the AJAX.NET version will make me want to shoot myself reading the source.


Jonathan Minond
12/26/2006 6:42:25 PM 17816 articles. 1 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 57

Thanks for the feedback! As it happens, ToggleButton builds on top of an underlying checkbox form element (asp:CheckBox), so an existing page that is ToggleButton-ified will continue to work just fine and the form elements will continue to submit the same information. You could obviously do the same with custom controls and custom script by building on your sample above, but one of the great things Toolkit controls do for page designers is make AJAX easy for everyone to get into. It may not be for everyone, though, so feel free to mix in your own stuff as you see fit! :)

This posting is provided "AS IS" with no warranties, and confers no rights.
1/3/2007 10:08:18 PM

Similar Artilces:

css toolkit adapters- apply css style to gridview row in code (c#)
I was trying to change the colour of a row in a gridview depending on data contained within using MyGridView_RowDataBound, and found a nice little change to the css adapters to allow this. Thought I should share. Add the following code before "return className.Trim();" in the function GetRowClass(GridView gridView, GridViewRow row) in GridViewAdapter.cs. (I keep this in ~/App-Code/Adapters/)if ((row.RowState == DataControlRowState.Normal)) { className += row.CssClass; } In your gridview css file add the colors you need EG: .MyGridViewCSSselectorCl...

Menu Divider or Seperator using CSS and or CSS adapters.
Great work on the Adapters.  I am attempting to create a menu with separator via CSS between specific items.  Please refer to for more detail with regards to plain (non css adapted) menus.  Is it possible using CSS adapters to specify a divider or separator between specific menu items, preferably using styles/css such as a border-bottom: 1px or even a 1 px high span/div tag with a background color?  Please note I don't want to apply this to all items in the menu, just specific ones.  Can this be done ...

CSS friendly adapters (beta3) can't find CSS file
Hello, I'm currently having some difficulties with the css friendly adapters. I'm building a website and I have a menu control. I installed everything of css friendly adapters and I made the few changes nessecrary to let it run. But it doesn't. I donk't know what wrong or anything but my website just can't find the external CSS file :|Anybody got an idea ? Thx  Okay then...With IE6 nothing works of CSS friendly adapters.. With IE7 it works though.Now what ? Gtz  Have you put the conditional <link> in your page (or master page)?  See

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 Menu Adapter + Ajax Control Toolkit
Hi all, I am facing a problem while using CSS control adapters in my Ajax enabled website.Could anybody please suggest me how to move forward in this scenario.  Thanks Anuradha Well, first- what problems are you facing?"If you have knowledge, let others light their candles in it." — Margaret Fuller...

ua.css html.css, hiddenWindow.html got moved from res/ to toolkit.jar
I just landed which moves a few important files read during startup into toolkit.jar in order to improve startup performance. See the bug for more details. Thanks, Taras Do we have an estimate of the Ts win here? Is this something we'd want to take on the 1.9.2 branch? cheers, mike On 2009-10-08, at 2:27 PM, wrote: > I just landed > which moves a few important files read during startup into > toolkit.jar in order to improve start...

CSS Friendly Adapters and .NET 3.5? Is it possible?
Hi, I'm using ASP.NET 2.0 CSS Friendly Control Adapters from CodePlex. I know adapters work properly under framework 2.0, but I'm building my project under Visual Studio 2008 (framework 3.5), so there are some incompatibilities. I can't get the Menu Control Adapters working properly (they are shown as <table> elements, but not as <div> elements). Did anyone get this working? Is there anyone working on it? Can anyone help me?I need to get this working as soon as possible, and my knowledge isn't powerful enough to improve the CSSFriendly library.  Tha...

CSS and buttons
Does anyone know if a property exists in CSS where you can set the border of a button to have the curved corners you see in the xp default buttons when you bring up IE?i could be wrong You won't be able to get the curved corners with CSS. The best you can do, if you really want the button to be curved is to use an image button....

css for a button
How to write css class for a button control.the button should look like ajax tab.i am new to this field.plz can anyone help on this <asp:Button ID="Button1" runat="server"/> Hi,use the CssClass attribute and provide the name of a class you put in your .css file.Something like:<asp:Button id="button1" runat="server" CssClass="myClass" /> and in the .css file.myClass {  ...} Grz, Kris. Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons....

I am having an issue where I am able to kill the CSS for any site I am on with Firebug and the only way to fix it seems to be to kill FireFox. While I am on any page. I open Firebug and I notice there are quirks.css and html.css which I understand to be part of FireFox. With Firebug, you can click the the left of the style and this "turns" this style off. Click the little red circle turns it back on. This works fine with any css except those 2. What happens instead is they disappear. Then something on the webpage will be missing. This carries across to all pages. So if I h...

Generate css in css file
Is it possible for VS to generate the style kode in ones .css file ?For instance if u make a div fragment, can u get it to write the syle code (margin, width, color etc.) the central .css file.By default it writes in directly in the div tag as a style attribute.Result should look like this:[Default.aspx] <div id='mainArea'>[stylesheet.css] #mainArea{width: 200;height: 200;// etc.}  No, unfortunately. Thats a feature of Microsoft Expression web designer. VS2005 isn't that good :( You have to make your own CSS file (VS2005 does have a good CSS editor though), then use t...

ua.css and html.css
Hi! The following CSS markup is messing up my site design. Can anybody explain what is happening here? Thank you!! ul, menu, dir {html.css (line 328) -moz-padding-start:40px; display:block; list-style-type:disc; margin:1em 0; } On 9/1/2008 6:14 PM, korsakov wrote: > Hi! The following CSS markup is messing up my site design. Can anybody > explain what is happening here? Thank you!! > > ul, menu, dir {html.css (line 328) > -moz-padding-start:40px; > display:block; > list-style-type:disc; > margin:1em 0; > } Maybe if you could send a link to the pr...

how can I add css classes (a:link, a:hover, body, td, .my_class, i.e.) in a WebCustomControl?? I want to generate css by custom control, without including a *.css external file in the html.. tnx bye! and I want to add the tag <style> in the <head></head> section, not in the <body> (as done with Response.Write("<style>...</style>")) Unless you have control in the almighty page, as an abstract page that is used throughout your site, you can control where are scripts can run into. Another way that you can take (although lengthy), is ...

Hi plz give me some tips about CSS........1.when i design a form what ever i put the control that will give a common look.........but in my few knowledge........lets take i have 10 textbox in a form... i created a css file....and put the file in every control properties... ex.go to properties of control-  then find css file file and put the css file name....but that is a lengthy process... but i want to know.....  when i design a form what ever i put the control that will give a common lookplz give me answer with writing code......Thanks & Regardspabitra&nb...

Web resources about - Toggle Button, ToolKit CSS, CSS Adapters -

Adapter - Wikipedia, the free encyclopedia
An electrical adapter may enable connection of a socket used in one region to a plug used in another by offering connections for the disparate ...

AC Adapter - Replacement Laptop AC Adapters
Online shopping for laptop ac adapters at the best price.Buy cheap ac adapters for your laptop computer.

M3 Adapter
Update the firmware of the M3i Zero GMP-Z003 card to support running in new 3DS (Ver. 4.1.0-8E, Ver. 4.1.0-8J, Ver. 4.1.0-8U) and DSi (Ver 1.4.4E, ...

Bluetooth RFCOMM / SDP connection to a RS232 adapter in android
The Android API provides examples of using listenUsingRfcommWithServiceRecord() to set up a socket and createRfcommSocketToServiceRecord() to ...

Mac App Store - Power Adapter Alarm
Get Power Adapter Alarm on the Mac App Store. See screenshots and ratings, and read customer reviews.

Apple USB Power Adapters - Flickr - Photo Sharing!
Comparison of various Apple USB power adapters for iPhone and iPod.

Miracast Wireless Display with Windows 8.1 - Stream PC to TV without Adapters! - YouTube
In this video, I demo native Miracast wireless display support on Windows 8.1 with Lenovo X1 Carbon Touch and Samsung Smart TV. You can use Miracast ...

Apple's iPhone 5 'Lightning' adapters will retail for $35 and $45, not available until October
Apple's decision to change the iPhone 5's dock connector means you'll need an adapter or two.

Travel tips: Do I need to pack a travel adapter?
Today's travellers have flown the nest of cords and plastic bits, but there is one essential gadget that cannot be underestimated.

Microsoft unveils Chromecast-like Wireless Display Adapter
Microsoft has put its spin on Google's Chromecast with a device that lets people mirror what's on their PC, laptop or smartphone wirelessly onto ...

Resources last updated: 12/25/2015 7:28:55 AM