Click here to Skip to main content
15,568,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have image saved in database in binary form .I want to display it in Jtable.

CSS
<script type="text/javascript">

    $(document).ready(function () {

        //Prepare jtable plugin
        $('#StudentTableContainer').jtable({
            title: 'The Student List',
            paging: true, //Enables paging
            pageSize: 10, //Actually this is not needed since default value is 10.
            sorting: true, //Enables sorting
            defaultSorting: 'Name ASC', //Optional. Default sorting on first load.
            actions: {
                listAction: '/PagingAndSorting.aspx/StudentList',
                createAction: '/PagingAndSorting.aspx/CreateStudent',
                updateAction: '/PagingAndSorting.aspx/UpdateStudent',
                deleteAction: '/PagingAndSorting.aspx/DeleteStudent'
            },
            fields: {
                StudentId: {
                    key: true,
                    create: false,
                    edit: false,
                    list: false
                },
                Name: {
                    title: 'Name',
                    width: '23%'
                },
                EmailAddress: {
                    title: 'Email address',
                    list: false
                },
                Password: {
                    title: 'User Password',
                    type: 'password',
                    list: false
                },
                Gender: {
                    title: 'Gender',
                    width: '13%',
                    options: { 'M': 'Male', 'F': 'Female' }
                },
               
            }
        });

        //Load student list from server
        $('#StudentTableContainer').jtable('load');
    });

</script>


Can any one help me to display it
Posted
Updated 31-Mar-21 2:37am

1 solution

The img tag can use binary for its image source if it is in base64 encoding. For example:

JavaScript
<img src="data:image/gif;base64,xxxxxxxxxxxxx...">  // just fill in your base64 encoded image
 
Share this answer
 

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