Friday, 14 February 2014

Jquery Date Picker

    <!--( Calender )-->
    <link href="../JS/Calender/calender.css" rel="stylesheet" />
    <script src="../JS/Calender/jquery-1.10.2.js"></script>
    <script src="../JS/Calender/jquery-ui.js"></script>

just call the methods in script tag:
 var @datemax, @datemin

  $("#txtofferexpires").datepicker("destroy");
  $('#txtofferexpires').datepicker({ dateFormat: 'mm/dd/yy', maxDate: @datemax, minDate: @datemin });

destroy clears the history of the calender.

@datemax, @datemin sets for maxdate and mindates which are enabled.


Friday, 7 February 2014

IMAGE MOUSEMOVE THEN WE GET ACTUAL IMAGESIZE

    /*------( THIS IS FOR IMAGE )--------*/
    $('.profileGraphic').live('mousemove', function (event) {
        var v_src = $(this).attr('src');
        v_src = v_src.replace('&type=square', '');
        v_src = v_src.replace('?preset=thumb', '');
        v_src = v_src.replace('sz=100', '');
        $('#imgpreview').attr('src', v_src);
        $('.popup').css({
            top: (event.pageY - 10),
            left: (event.pageX + 10),
            display: 'block'
        });
    }).live('mouseout', function () {
        $('#imgpreview').attr('src', '');
        $('.popup').css({ display: 'none' });
        return false;
    });

   <!--IN ASPX/HTML IMAGE POPUP-->
                    <div class="popup">
                            <img id="imgpreview" src=""/>
                        </div>

<!--CSS STYLE -->
.popup
{
    position: absolute;
    display: none;
    z-index: 111111;
    border-collapse: collapse;
    border: solid 3px white;
}

working with JSON calling Type ' POST '

('#btnsendoffer').live('click', function () {
    $('.loadingoffer').show();
    $('#sendoffer').css('display', 'none');
    try {
   /*---( offerterm is ddl selected value )---*/
 var _OfferTerm = $("#ddlofferterm option:selected").val();
    var _OfferExp = $('#txtofferexpires').val();
    var _OfferDesc = $('#txtofferdescription').val();
    //alert(_Ichkoffer)
    if (_CampaignId != '' && _Ichkoffer != '' && _OfferExp != '') {
        $.ajaxSetup({
            cache: false
        });
        $.ajax({
            type: 'POST',
            url: '../web/Login.asmx.aspx/MakeOffer',
            data: '{"strCampaignID":"' + _CampaignId + '","strInfluencerIDs":"' + _Ichkoffer + '","strOfferExp":"' + _OfferExp + '","strOfferTerm":"' + _OfferTerm + '","strOfferDesc":"' + _OfferDesc + '"}',
            contentType: 'application/json; charset=urf-8',
            cache: false,
            datatype: 'json',
            success: function (makeoffer) {
                if (makeoffer.d == '') {
                    $('.divofferpopup .divoffercontent').html('<font style="font-size: large; color: red;">Failed to send Offer</font><br/><br/><font>Please contact FYI Team.</font><br/>)
                }
                else {
                    $('#sendoffer').css('display', 'none');
                    $('.divofferpopup .divoffercontent').html('<font style="font-size: large; color: green;">Offer(s) Sent Successfully</font>').css({ "display": "block", "text-align": "center" });
                }
            },
            error: function (xhr, msg) { },
            complete: function (xhr, status) {
                $('.loadingoffer').hide();
            }
        });
    }
    else { alert('Please check the inputs'); return false;}
    } catch (error) {
        $('.loadingoffer').hide(); hideofferpopup();
    }
});

Getting more Checkbox:checked values / id's

 var _Ichkoffe= $('.selectoption input[name=docheck]:checked').map(function () { return this.value; }).get().join(",");

/*-----( checkbox checked is true / false )-----*/
    $('.selectoption input[name=docheck]:checked').attr('checked', false);
            $(this).parent().parent().parent().parent().parent().parent().find('.selectoption input[name=docheck]').attr('checked', true)
    /*-----(Getting value )------*/  
 _Ichkoffer = $(this).attr("value");

Getting RadioButton values and id's also label text

    var _TEXT= $('input:radio[name=rbnPlans]:checked+ label').text();
    var _VAL= $('input:radio[name=rbnPlans]:checked').val();
    var _ID = $('input:radio[name=rbnPlans]:checked').attr('id');

Saturday, 9 November 2013

Diff betweeen Jquery and Javascript

Javascript:

JavaScript is a scripting language that was designed for use within a web browser. Typically, JavaScript is used for interface interactions. Slideshows and other interactive components are typically done using JavaScript.


Jquery:

This will work on top of the javascript where it has the script plugins which can use flexible and easy to write functions, event handlers.

Monday, 16 September 2013

get all procedures in SQL server

select * from sysobjects where type ='p' order by crdate desc

                  or

--->>Getting Specified procedure Details

SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
AND name = 'SP_NAME'

Extracting Nupkg files using command line

Rename it to zip first then extract files as below 1.     Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2.     Make sure to repla...