Click here to Skip to main content
15,671,149 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using this code to play a video on click on link button in DataList

protected void DataList1_ItemCommand1(object source, DataListCommandEventArgs e)
        if (e.CommandName == "select")

                embed1.Attributes.Add("src", @"http://~/Uploads4/");



In aspx page code is like this

<asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />
    <ajaxtoolkit:modalpopupextender ID="modal1" 
            TargetControlID="hiddenTargetControlForModalPopup" PopupControlID="Panel1" 
             runat="server" BehaviorID="bhvModel1">
    <asp:Panel ID="Panel1" runat="server" Height="346px" Width="553px">
    <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="Player1">

        <param name="URL" value="http://localhost/Music.wmv">

        <param name="http://path_to_the_video">

        <param name="AutoStart" value="1">

        <param name="ShowControls" value="1">

        <param name="ShowStatusBar" value="1">

        <param name="ShowDisplay" value="1">

        <param name="stretchToFit" value="1">

        <embed runat="Server" id="embed1" type="application/x-mplayer2"


width="424" height="379" 

 autostart="1" showcontrols="1" showstatusbar="1">



all things are works when i paly video filename as c:/Wildlife.wmv
but when it fetch from database AS ~\Uploads4\Wildlife.wmv It does not paly.
if in data base i take C:/Wildlife.wmv then it paly by fetching from database.

~\Uploads4\Wildlife.wmv path inserted automatically from uploding a file.
What is the problem.
please help me.

1 solution

It has been done when using

instead of
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