Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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.
JavaScript
<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>
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900