Javascript daha dogrusu jquery ile dinamik cookie kontrolü ve digerleri
 
<a href="http://www._20122013.jpg" rel="lightbox" alt="Deneme Yap" id="kayit2012"></a>
<script type="text/javascript">
( function($) {
$(document).ready(function () {

if($.cookie("kayit2012") == null) 
{
$('#kayit2012').click();
        var trh= new Date();
        trh.setTime(trh.getTime() + (3 * 60 * 1000));
        $.cookie("kayit2012","1", {expires: trh });
        //$.cookie("kayit2012","1", {expires: 1});
}


}); 
} ) ( jQuery );
</script> 
 
---- 
 
document.forms[0].txt_kullanici.focus();
 
----
 
tab = document.getElementById('tbadmin');
tab.className = "redHotWebDealsli";
 
----
 
<asp:TextBox ID="txt_sirano" runat="server" Width="100px"  autocomplete="off" AutoCompleteType="Disabled" ></asp:TextBox>  
 
---------- 
 
function toggle(id) {
           var e = document.getElementById(id);
           if (e.style.display == 'block')
               e.style.display = 'none';
           else
               e.style.display = 'block';
       } 
<a id="myHeader1" href="#" onclick="toggle('yeniekle');" >Yeni Ekle</a>
<div id="yeniekle" style="display:none"></div>
 
---- ajax auto suggest
 
 var v = $("[id$=ddl_r3_BRM_ID] option:selected").val();
  $('[id$=txt_r3_muellif]').autocomplete('Suggest.ashx?t=Muracatlar&k=Muellifi&B='+v+'&s=m');
       
 
 
--------------------------------------------------
 
<script type="text/javascript">
document.getElementById("ctl00_ContentPlaceHolder1_TextBox1").type = "number";
</script>
 
 
---------------------------------------------------
 

ClientScript.RegisterStartupScript(GetType(), "YeniPencere", @"<script language='javascript'>alert(' Yeni sipariş kaydedildi. ');window.location.href = 'inside.aspx';</script>");

Datalist rownumber : <%#Container.ItemIndex+1 %>

JS yanlızca sayı girile bilmesi :  onkeypress="validate(event);" 

    function validate(evt) {

        var theEvent = evt || window.event;
        var key = theEvent.keyCode || theEvent.which;
        key = String.fromCharCode(key);
        var regex = /[0-9]|\,/;
        if (!regex.test(key)) {
            theEvent.returnValue = false;
            if (theEvent.preventDefault) theEvent.preventDefault();
        }
    } 

JS ile textboxun içindekini focus olunca tutma, değişmemisse çıkınca geri atama 

    var eski = ""; 
    function tut(element) {
        eski = element.value;
        element.value = '';
    }
 

   function ver(element) {
        if ('' == element.value) {
            element.value = eski;
            element.style.background = '#FFFFFF';
        }
        else
            element.style.background = '#A9F5BC';
    }

 

 İsk. 1:<asp:TextBox ID="txt_st_i1" runat="server" Width="40px" onfocus="tut(this);" onblur="ver(this);" onkeypress="validate(event);" >0</asp:TextBox> 
 
 
 
-------------------------------------------
 
Postback de divin scroll unu hatırlamak  :
 
  $( document ).ready(function() {     
           document.getElementById('urunlerimiz').scrollTop = document.getElementById('scrollhatirla').value;
}); 
veya 
  <body onload="javascript:document.getElementById('urunlerimiz').scrollTop = document.getElementById('scrollhatirla').value;">
 
yaptıktan sonrada
<input type="hidden" id="scrollhatirla" runat="server" /> 
<div id="urunlerimiz" style="overflow: auto; height: 300px;" onscroll="javascript:document.getElementById('scroll').value = this.scrollTop"> 
 
 
-------------------------------------------
 
<asp:CheckBox ID="chk_sec" ToolTip='<%#Eval("SPD_ID")%>' Visible="<%# ShouldBeVisible %>" runat="server"  />
 
        protected bool ShouldBeVisible
        {
            get
            {
                return !pnl_asama2.Visible;
            }
        } 
 
-------------------------------------------- 
 
  JS ile input temizleme - clear textbox on click
 
 onclick="javascript:this.value='';"
 
 
Close to ColorBox within the iframe
 
<script src="bower_components/jquery/dist/jquery.min.js"></script>
    <script type="text/javascript" language="javascript">
        function kapa()
        {
            parent.$.fn.colorbox.close();
        }
    </script>