locked
Visual Basics Bind <iframe> or <video> to a literal control RRS feed

  • Question

  • User2021171944 posted

    Because I am not using Visual Basics for Windows , but using Visual Basics MVC I am not able to display a video. The problem is , each member using Email as their primary login has the ability to upload a video file to display their video talent. so , within Form view, I can successfully upload a video to a Video/FeaturedVideo/ folder. There are no video controls available for Visual Basics Web Applications, I have to use HTML code. In Item template, I want to be able to connect their video the member uploaded to play. what I did was added a iframe or video control (preferably).  I did an <frame> where the src=<%# Eval("FeaturedVideo") %> . I expected to play because I pointed to the the data column. My label controls and literal controls point exactly to the video and file. for example ~/video/FeaturedVideo/54321_001video.mp4.  where 54321 is a system made number assigned to the video.  Then I read I have to assign the iframe to a literal control in order for the video to play. same thing for a video control. Reminder, all of these thing are done in a FormView, not GridView control.  any help or solid example would be appreciated.

    Monday, February 5, 2018 5:23 PM

All replies

  • User-1838255255 posted

    Hi wmoncure, 

    According to your description, as far as i know, you want to use iframe to load video, but this iframe need a URL to load video, but this URL is made up of label and literal's value, so you want to bind these value to URL. If my understanding is right, please check the following code: 

    1. you need find the text of label and literal control.
    2. write the video path with label and literal's text.
    3. find iframe control in the code behind , then find out src attribute then assign the video path to it. 

    Note: iframe is a html tag, if you want to use it in code behind, need add runat="server" inside tag. 

    if my understanding is not, please correct me! 

    Best Regards,

    Eric Du 

     

    Tuesday, February 6, 2018 8:48 AM
  • User2021171944 posted

    Thank you for your response Eric.. I believe you know what im looking for . do you have an example for the front end code and the backend code. Im new to VB and the don't know how to code this. for now lets just say its iframe I choose. and keeping in mind its in Formview. My upload works very well. Thanks for your time.

    Wednesday, February 7, 2018 4:39 PM
  • User-1838255255 posted

    Hi wmoncure,

    According to your description and needs, I think you could check this tutorial about how to achieve it, although this tutorial retrieving image with file path, but the result is the same as video. 

    Retrieve images using a file path stored in database in ASP.Net: 

    https://www.aspsnippets.com/Articles/Retrieve-images-using-a-file-path-stored-in-database-in-ASPNet.aspx 

    Best Regards,

    Eric Du 

    Wednesday, February 14, 2018 9:20 AM
  • User2021171944 posted

    I will try this out. and let you know.  Thank you very much.

    Wednesday, February 14, 2018 3:18 PM