Wednesday 27 July 2016

How to call web api using Ajax call

 <script>
        $(document).ready(function () {
            $("#Save").click(function () {

                var person = new Object();
                person.name = $('#name').val();
                person.surname = $('#surname').val();

                $.ajax({
                    url: 'http://localhost:11023/api/values/Get',
                    type: 'POST',
                    dataType: 'json',
                    data: person,
                    success: function (data, textStatus, xhr) {
                        console.log(data);
                    },
                    error: function (xhr, textStatus, errorThrown) {
                        console.log('Error in Operation');
                    }
                });


            });
        });
    </script>

 Name :- <input type="text" name="name" id="name" />
        Surname:- <input type="text" name="surname" id="surname" />
        <input type="button" id="Save" value="Save Data" />



public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

Tuesday 19 July 2016

<div data-WRID="WRID-146894924273191428" data-widgetType="productBanner"  data-class="affiliateAdsByFlipkart" height="240px" width="120px"></div><script async src="//affiliate.flipkart.com/affiliate/widgets/FKAffiliateWidgets.js"></script>
<div data-WRID="WRID-146894924273191428" data-widgetType="productBanner"  data-class="affiliateAdsByFlipkart" height="240px" width="120px"></div><script async src="//affiliate.flipkart.com/affiliate/widgets/FKAffiliateWidgets.js"></script>