在Webform中显示视频

本文关键字:视频 显示 Webform | 更新日期: 2023-09-27 18:23:47

我想获得一个存储在本地数据库中的视频url,并将其显示在Web表单中。我的问题是,我不知道如何将url从代码隐藏类传递到webform。我已经通过将文本属性设置为图像url来使用标签显示图像,但对于视频来说,这不起作用。

显示的图像如下:

        string image;
        string video;
        Advertisement Ad= BusinessLogic.getAd(9);
        image = Ad.getImage();
        video = Ad.getVideo();
        ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('" + image + "');", true);
       lblImage.Text = "<img alt='' style=width:150px; height:150px src='" + image + "'/>";
       }

如何通过在运行时设置url来显示视频?

谢谢你抽出时间。

在Webform中显示视频

试试这个:

lblVideo.Text = "<video width=320px height=240px src='" + video+ "'/>";