Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 3rd, 2009, 12:26 PM
Authorized User
 
Join Date: Oct 2009
Posts: 31
Thanks: 11
Thanked 0 Times in 0 Posts
Default Runtime selection of video in ASP web site using <object> tag

Hi Imar...

I have included <object> tag in my website to render video....
Code:
<object type="video/x-ms-wmv" width="420" height="340">
  <param name="src" value="../Abc.wmv" />
  <param name="autostart" value="false" />
  <param name="controller" value="true" />
</object>
But, in
Code:
<param name="src" value="../Abc.wmv" />
, each time, i have specified the video file explicitly to value attribute...

As, given in your book, i want to have the data bind just like
Code:
<asp:Image ID="ImageUrl" runat="server" ImageUrl='<%# Eval("ImageUrl")%>' />
for <object>...

Is that possible...

My intention is to create a webpage which can play video... But the video which it plays should be determined at runtime...

As in your book's picture gallery, where picture ll be displayed depending on the selected picture album, i want to have a video gallery ,where video is displayed depending on the selected video album...

The only info which i want now to accomplish this idea is about "the runtime selection of video file"... How can this be done sir......

Please help me...
Thank you in advance...

Last edited by varunbwj; December 3rd, 2009 at 12:28 PM..
 
Old December 3rd, 2009, 12:53 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can place a Literal control inside your code and bind that Literal...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
varunbwj (December 8th, 2009)
 
Old December 6th, 2009, 04:07 AM
Authorized User
 
Join Date: Oct 2009
Posts: 31
Thanks: 11
Thanked 0 Times in 0 Posts
Default Thanks Imar

Thanks Imar...

Using Literal control to bind data, as you said, it was possible to enter the url of video file in database...

Thanks...

But, my intention is to create a webpage which can play video... But the video which it plays should be determined at runtime...

As in your book's picture gallery, where picture ll be displayed depending on the selected picture album, i want to have a video gallery ,where video is displayed depending on the selected video album...

How can i accomplish this Sir...

Thanking you in advance....
 
Old December 6th, 2009, 06:17 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You can do it exactly as done in the book. Have a DropDownList to display the albums and use a ListView for the videos. Rather than using an asp:Image with an ImageUrl, you enter the necessary <object> HTML inside the ItemTemplate and use a Literal to display the video URL.

I believe there is an exercise at the end of Chapter 13 on displaying the image on a details page, in case you don't want to show all your videos at once.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 7th, 2009, 03:12 AM
Authorized User
 
Join Date: Oct 2009
Posts: 31
Thanks: 11
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I have followed your book to get all the things done expect about linking this <object> tag dynamically to specific video... This is the "code in vain" in which i have tried to link <object> tag to "runtime time selected video url"...
Thats actually my problem...

Code:
<%@ Page Title="Videos Gallery" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Videos.aspx.cs" Inherits="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
        DataSourceID="LinqDataSource1" DataTextField="Name" DataValueField="Id">
    </asp:DropDownList>  
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="Id" 
        DataSourceID="LinqDataSource2">
        <ItemTemplate>
           
            Description:
            <asp:Label ID="DescriptionLabel" runat="server" 
                Text='<%# Eval("Description") %>' />
            <br />
            
            <object type="video/x-ms-wmv" width="420" height="340">
  <param name="src" value="<%# Eval("VideoUrl") %>" />
  <param name="autostart" value="false" />
  <param name="controller" value="true" />
</object>
            
            VideoUrl:
            <asp:Literal ID="VideoUrlLabel" runat="server" Text='<%# Eval("VideoUrl") %>' />
            <br />
            
            
        </ItemTemplate>
        
        <EmptyDataTemplate>
            <span>No data was returned.</span>
        </EmptyDataTemplate>
       
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span ID="itemPlaceholder" runat="server" />
            </div>
            <div style="">
                <asp:DataPager ID="DataPager1" runat="server">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                            ShowLastPageButton="True" />
                    </Fields>
                </asp:DataPager>
            </div>
        </LayoutTemplate>
        
       
    </asp:ListView>
    <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
        ContextTypeName="NanasuManageVideoGalleryClassDataContext" 
        TableName="VideoDetails" Where="VideoAlbumId == @VideoAlbumId">
        <WhereParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="VideoAlbumId" 
                PropertyName="SelectedValue" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="VideoGalleryManagingClassDataContext" 
        Select="new (Id, Name)" TableName="VideoAlbums">
    </asp:LinqDataSource>
    </ContentTemplate>    
    </asp:UpdatePanel>
</asp:Content>
Actually, i am not getting how to enter the necessary <object> HTML such that "runtime selected Video url" is played...

Can it be done by using <object> tag sir... Or else, is there any other way to accomplish this task like by using silverlight or any thing else...

Thanking you in advance...

Last edited by varunbwj; December 7th, 2009 at 03:15 AM..
 
Old December 7th, 2009, 03:29 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Ah, so this is more about the actual player than it is about ASP.NET, right?

Depending on the video, you can use Flash, QuickTime, Silverlight or another player. For example, for Flash movies you can use JW Player: http://www.longtailvideo.com/players/jw-flv-player/

Each player requirs different code (often the <object> element) to embed the player in a page.

You'll need to search Google a bit and search for a player that matches your video format(s) and your budget.

You could also decide to upload your movies to a site like YouTube and link to those.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following 2 Users Say Thank You to Imar For This Useful Post:
kiwibrit (December 7th, 2009), varunbwj (December 8th, 2009)
 
Old December 7th, 2009, 04:14 AM
Authorized User
 
Join Date: Oct 2009
Posts: 31
Thanks: 11
Thanked 0 Times in 0 Posts
Default Thank you Imar

Hi Imar,

Thanks for the information... I ll do as you have said...

Thank again...
 
Old December 7th, 2009, 02:40 PM
Authorized User
 
Join Date: Jun 2009
Posts: 70
Thanks: 18
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by Imar View Post
...... for Flash movies you can use JW Player: http://www.longtailvideo.com/players/jw-flv-player/ ....
And that little gem is an example of why I lurk this forum. I am surprised I had not come across JW Player before - but I hadn't. Thanks.
 
Old December 7th, 2009, 03:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, it's quite a nice player. One of my colleagues showed it to me some time ago...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8: <asp:image> inside <a> & ext.CSS (pg. 274) epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 July 12th, 2008 04:37 AM
web.config <compilation> <assemblies> Jophie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 10th, 2008 12:04 PM
<OBJECT> tag in IE doesn't work jtrifts HTML Code Clinic 1 August 30th, 2007 11:36 AM
Using Java Applets and the <object> tag Alexpizzoferro HTML Code Clinic 5 May 25th, 2004 07:55 PM
a problem in book<<beginning asp.net using vb>> luoware ASP.NET 1.0 and 1.1 Basics 3 December 8th, 2003 09:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.