Click here to Skip to main content
15,884,739 members
Articles / Web Development / ASP.NET

Video Uploader Control for SQL Server

Rate me:
Please Sign up or sign in to vote.
4.54/5 (31 votes)
28 Nov 2007CPOL2 min read 288.2K   9.9K   124  
Upload and insert video, audio, or image to SQL Server, and show it in an ASPX page.
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register src="UploadVideo.ascx" tagname="UploadVideo" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <uc1:UploadVideo ID="UploadVideo1" runat="server" />
    
    </div>
    <br />
    <br />
    <asp:Button ID="ButtonShowVideo" runat="server" onclick="ButtonShowVideo_Click" 
        Text="Show Video" />
    <br />
    <asp:Repeater ID="Repeater1" runat="server">
        <ItemTemplate>
            <object id="player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" 
                        height="170" width="300">
                        <param name="url" value='<%# "VideoHandler.ashx?id=" + Eval("ID") %>'/>
                        <param name="showcontrols" value="true" />
                        <param name="autostart" value="true" />
                    </object>
        </ItemTemplate>
    </asp:Repeater>
    <br />
    <br />
    <br />
    <asp:Button ID="ButtonBind" runat="server" onclick="ButtonBind_Click" 
        Text="Bind" />
    <asp:GridView ID="GridView1" runat="server" BackColor="White" 
        BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        ForeColor="Black" GridLines="Vertical">
        <footerstyle backcolor="#CCCC99" />
        <rowstyle backcolor="#F7F7DE" />
        <Columns>
            <asp:templatefield>
                <ItemTemplate>
                    <object id="player" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" 
                        height="170" width="300">
                        <param name="url" value='<%# "VideoHandler.ashx?id=" + Eval("ID") %>'/>
                        <param name="showcontrols" value="true" />
                        <param name="autostart" value="true" />
                    </object>
                </ItemTemplate>
            </asp:templatefield>
        </Columns>
        <pagerstyle backcolor="#F7F7DE" forecolor="Black" horizontalalign="Right" />
        <selectedrowstyle backcolor="#CE5D5A" font-bold="True" forecolor="White" />
        <headerstyle backcolor="#6B696B" font-bold="True" forecolor="White" />
        <alternatingrowstyle backcolor="White" />
    </asp:GridView>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer Business Development Gate
Egypt Egypt

Comments and Discussions