Wednesday, July 6, 2011

Get Session value With Jquery In Asp.net


    
   

$(document).ready(function () {
$("#ContentPlaceHolder1_Btnpos​t").click(function () {

var val = '<%=Session["UserID"]%>';

if (val != '') {

return true;
}
else {
alert('Please Login First Before Post Comment.');
return false;
}

});
});

2 comments:

  1. auto complete off in javascript

    ------------------------------------


    $(document).ready(function () {
    try {
    if (document.getElementsByTagName) {
    var inputElements = document.getElementsByTagName("input");
    for (i = 0; inputElements[i]; i++) {
    if (inputElements[i].type == "text") {
    inputElements[i].setAttribute("autocomplete", "off");
    }
    }
    }
    }
    catch (e)
    { }
    });

    ReplyDelete