Search code examples
visual-studio-lightswitchlightswitch-2012

How to manage images with image database field?


In the LightSwitch 2012 HTTP Client solution, How to manage images within forms?. I want to upload/Edit images fields from sql database but this fields only shows blank space and nothing Action when I tap over them.

Only I want to do is when I tap over the image field opens popup and select a image I want to save to the "photo" field on sql database table.

Thanks in advance


Solution

  • In order to solve this issue I use custom control in image field (within the screen design) and then I put this code in control:

    myapp.AddEditMonumentoItem.ImagenPrincipal_render = function (element, contentItem) {

    createImageUploader(element, contentItem, "max-width: 300px; max-height: 300px");

    };

    Previusly I add jquery-uploader.js and image-uploader-base64-encoder.aspx files to project script folder .