Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Changing the <embed src="" > in asp.net

Posted on 2009-02-13
6
Medium Priority
?
426 Views
Last Modified: 2012-06-21
I had this working, but I did not check it into my source control, now it is over written and I can't not seem to remember the solution. I do however know it was not javascript as most of the other suggestions seem to point to. What I have is the below code in an .aspx page. What I need to do is dynamically add the src of the video upon selecting a product to view. Also, I need to make the asp:panel visible, and I am using a hyperlink and can't seem to get that working either, lol. It's Friday so my brain must be on weekend already.

<div id="vidPan">
          <asp:panel id="videoPanel" runat="server" height="500px" width="500px"><TABLE style="WIDTH: 177px"><TBODY><TR><TD style="WIDTH: 647px; HEIGHT: 499px" colSpan=3 rowSpan=3>
          
          <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" showstatusbar="true" enablecontextmenu="false" autostart="false" width="450" height="450" loop="false" src="" runat="server" id="media"/>
          
          </TD></TR><TR></TR><TR></TR></TBODY></TABLE></asp:panel>
          </div>

Open in new window

0
Comment
Question by:GLIanimal
  • 3
  • 2
6 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 23633647
Are you using a plain old hyperlink or an asp.net link button?
0
 
LVL 41

Expert Comment

by:Kyle Abrahams
ID: 23633656
what if you did an inline call to asp.net

<embed src="'<%getsrc()%>'">
0
 

Author Comment

by:GLIanimal
ID: 23633690
I am using a hyperlink currently.

As far as the inline call, never done that before. Do I need to set a public function or something?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 19

Accepted Solution

by:
daveamour earned 1000 total points
ID: 23633693
Try something like this....
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ChangeEmbed.aspx.cs" Inherits="ChangeEmbed" %>
 
<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="vidPan">
        <asp:Panel ID="videoPanel" runat="server" Height="500px" Width="500px" Visible="false">
            <table style="width: 177px">
                <tbody>
                    <tr>
                        <td style="width: 647px; height: 499px" colspan="3" rowspan="3">
                            <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
                                name="mediaplayer1" showstatusbar="true" enablecontextmenu="false" autostart="false"
                                width="450" height="450" loop="false" src="" runat="server" id="media" />
                        </td>
                    </tr>
                    <tr>
                    </tr>
                    <tr>
                    </tr>
                </tbody>
            </table>
        </asp:Panel>
        
        <asp:LinkButton ID="MyLink" Text="Click Me" runat="server" 
            onclick="MyLink_Click"></asp:LinkButton>
    </form>
</body>
</html>
 
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class ChangeEmbed : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void MyLink_Click(object sender, EventArgs e)
    {
        videoPanel.Visible = true;
 
        media.Attributes["src"] = "blah";
    }
}

Open in new window

0
 

Author Comment

by:GLIanimal
ID: 23633804
Ok, that one part is what I was looking for, the media.Attributes["src"]. However is there a way to do this with the hyperlink? I realize it doesn't have an click event, but curious as to how I did this before.
0
 
LVL 19

Expert Comment

by:daveamour
ID: 23633816
Well when you click the hyperlink this will go to a page and then on that page you can read the querystring and thne set the src again based on the querystring - the code will be the same kind of thing, you just won't be using a normal event handler that's all.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question