Click here to Skip to main content
14,665,095 members
Rate this:
Please Sign up or sign in to vote.
See more:
Is there any possibility to retrieve data from a datacolumn of an sql table on mouseover
on an image.

Thanks.
Posted
Comments
   
What have you tried and where is the problem?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Yes possible, i can give you a idea

1.On Mouse hover call a AJAX GET Method
2.Write a method to fetch desire record from DB

Here is a small eg. that show how it work.
<script type="text/javascript" language="javascript">
var addingProduct = false;

function AddProduct() {                 

    $.ajax({
        type: 'Get',
        url: '/Home/getCategory',
        data: {
            lastProduct: parseInt($("#hdnConfirm").val())
        },
        async: true,
        dataType: "html",
        success: function (data) {
            if (data !== null && data !== "") {
                addingProduct = false;
                //alert(document.getElementById('hdnCatCount').value);
                $('#initialCategoryDiv').append(data);
                document.getElementById('hdnConfirm').value = (parseInt(document.getElementById('hdnConfirm').value) + 1);
                $('#timelinecontentround').hide();
            }
        },
        error: function (xhr, ajaxOptions, thrownError) {
            $('#timelinecontentround').hide();
        }
    });
    return false;
}

$(window).load(function () {
    document.getElementById('hdnConfirm').value = 1;

});               
</script>
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100