Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Wednesday, August 19, 2009

Convert String to System.Drawing.Color in ASPX C#

Here is a small example of how to convert a System.Drawing.Color to the HTML color format (Hex value or HTML color name value) and back.

System.Drawing.Color c = System.Drawing.ColorTranslator.FromHtml("#F5F7F8");
String strHtmlColor = System.Drawing.ColorTranslator.ToHtml(c);

Thursday, July 30, 2009

Show/Hide from JavaScript Code

To make a DIV visible or hidden from JavaScript use the code

<script type="text/javascript">
    var DivToApply = document.getElementById("Div1");
    DivToApply.style.visibility = "visible";
    DivToApply.style.visibility = "hidden";
</script>



Tuesday, July 14, 2009

Make a Checkbox Read-Only

To make a html input type checkbox readonly is not possible from its default properties. So we can just use this small tricks to make it read only.

<input type="checkbox" onClick="return false;" CHECKED />Readonly
<input type="checkbox" CHECKED DISABLED />Disabled

It looks like: