The user needs to be able to change which video will appear on the website - I need to be able change the videoURL in the code behind which will be queried from a database in my asp.net C# application.
Thanks, I tried that and still doesn't work on pageload. The video plays fine when url is in the tag - anything I do to change it in the code behind it doesn't work.
Also on the html side it a blue squiggly line underneath '<%=VideoUrl %>' on mouse over it reads "This is not a scriptlet. Will be output as plaintext."
Also on the html side it a blue squiggly line underneath '<%=VideoUrl %>' on mouse over it reads "This is not a scriptlet. Will be output as plaintext."
you want plain text. Have you tried view the HTML source? Perhaps share your code?
Member
1 Points
4 Posts
Change a video url in code behind
Jan 29, 2020 08:47 PM|llmclaughlin|LINK
If have this tag on the html5 side
<a class="player" id="encourage" runat="server" data-property="{videoURL:'https://www.youtube.com/watch?v=jbxg',containment:'#home', showControls:false, autoPlay:true, loop:true, mute:false, startAt:0, opacity:1, quality:'default'}"></a>
The user needs to be able to change which video will appear on the website - I need to be able change the videoURL in the code behind which will be queried from a database in my asp.net C# application.
Any suggestions?
Thanks
Louie
All-Star
52971 Points
23574 Posts
Re: Change a video url in code behind
Jan 29, 2020 08:57 PM|mgebhard|LINK
Use code blocks,<% %>, and a property.
<a class="player" id="encourage" data-property="{videoURL:'<%=VideoUrl %>',containment:'#home', showControls:false, autoPlay:true, loop:true, mute:false, startAt:0, opacity:1, quality:'default'}"></a>
Member
1 Points
4 Posts
Re: Change a video url in code behind
Jan 29, 2020 09:10 PM|llmclaughlin|LINK
Thanks, I tried that and still doesn't work on pageload. The video plays fine when url is in the tag - anything I do to change it in the code behind it doesn't work.
Member
1 Points
4 Posts
Re: Change a video url in code behind
Jan 29, 2020 09:19 PM|llmclaughlin|LINK
Also on the html side it a blue squiggly line underneath '<%=VideoUrl %>' on mouse over it reads "This is not a scriptlet. Will be output as plaintext."
All-Star
52971 Points
23574 Posts
Re: Change a video url in code behind
Jan 29, 2020 09:21 PM|mgebhard|LINK
Try removing the runat=server attribute. Other than that I get markup that matches your original code. Not sure what else I can do...
All-Star
52971 Points
23574 Posts
Re: Change a video url in code behind
Jan 29, 2020 09:23 PM|mgebhard|LINK
you want plain text. Have you tried view the HTML source? Perhaps share your code?
Member
1 Points
4 Posts
Re: Change a video url in code behind
Jan 29, 2020 09:23 PM|llmclaughlin|LINK
That was it, Thanks.
Louie