Coderock

--------------------------------
link hover image

Prepopulated textbox value to disappears onclick

Frontpage calendar image November 21, 2014

How to prepopulated textbox value to disappears onclick? < asp:TextBox ID=”txtValue” runat=”server” onfocus=”(this.value==’Enter Text’)?this.value=”:this.value=this.value” onblur=”(this.value==”)?this.value=’Enter Text’:this.value=this.value” >< /asp:TextBox>    

link hover image

How to align vertically a < div> to the middle of the page

Frontpage calendar image October 26, 2014

< body> < div style="width:900px; margin:0 auto;"> centered content here < /div> < /body>

link hover image

document.getElementById(‘id’).value failing in ASP.net javascript function

Frontpage calendar image May 10, 2014

When you place runat=”server” in an standard HTML tag, ASP.Net mangles the ID to ensure that it’s unique (just like it does with its own controls). You need to access the element using the ID that ASP.Net assigned. Try this: Hidden fields: < input id=”hidOrg1″ type=”hidden” value=”” / > < input id=”hidBT” type=”hidden” value=”” / […]

link hover image

Javascript: Button’s .click() command not working in Chrome

Frontpage calendar image November 30, 2013

I have a button: < asp:ImageButton ID=”btnLogin” OnClick=”btnLogin_Click” runat=”server” ImageUrl=”images/btns/loginb.png” Width=”95″ Height=”30″ ToolTip=”Login” / > and when I click it, everything works as expected, however when I have a javascript function call it using btn.click(), the click command is not executed. My javascript function is: function doClick(buttonName, e) { var key; if (window.event) key = […]

link hover image

HTML: How to be sure the browser is using the latest CSS file ?

Frontpage calendar image November 28, 2013

Problem You keep updating your CSS stylesheet but the browser load the old one from cache and so when a returning visitor loads the site, the layout gets screwed up. This is basically a CSS caching problem. Solution: Since the browser won’t recognize an update in the CSS, you can basically “fool” the browser into […]

link hover image

Create a print button on your page

Frontpage calendar image November 28, 2013

How to create a print button on your page: < a href="#" mce_href="#" onClick=" window.print(); return false">Print this page< /a>

link hover image

ASP.NET with JQuery: youtube like progress bar

Frontpage calendar image September 10, 2013

How to create an Youtube progress bar in ASP.NET with JQuery with like and unlike buttons. If you click like progress bar will increase, if you click unlike progress will decrease. In .aspx file In < Head > will place the jquery: < script type=”text/javascript”> $(function () { $(“#progressbar”).progressbar({ value: parseInt($(“#hdnValue”).val()) // convert string hdnValue […]

link hover image

jsFiddle.net

Frontpage calendar image July 31, 2013

jsFiddle is an online Integrated Development Environment  that is hosted in a browser allowing users to create and execute code written in JavaScript, html, and css. It has features enabling users to learn and demonstrate how JavaScript, HTML, and CSS work together, and is often used to provide live examples of problems being encountered.    

link hover image

HTML and CSS: popup with background disabled

Frontpage calendar image May 1, 2013

If you need a script to generate a popup when page loads with background disabled like

link hover image

HTML and CSS: How to place a div in the center of the screen

Frontpage calendar image April 30, 2013

I wanted a image to be centered exactly in the middle of the screen, that is, both vertically and horizontally centered. To place < div> in center of screen: just add position:fixed and it will keep it in view even if you scroll down.