Dynamic rich media component for ASP.Net Flash, Video, Audio, FlashVideo and ToolTip / Balloon Help controls for C# and VB.Net
Welcome Guest Search | Active Topics | Members | Log In | Register

Add from code behind? Options · View
campbke
Posted: Wednesday, November 11, 2009 7:11:27 PM
Rank: Newbie
Groups: Member

Joined: 11/11/2009
Posts: 1
Points: 3
Location: USA
I've been a C# developer for several years but am just now getting into web development... so this question may be more of a markup question than the actual control, but anyway...

I'm wanting to dynamically add a number of these controls in the code behind based off of a return from a web service. I'm creating the table dynamically, along with the cells, etc, and everything works fine, but when I create a new instance of the video control it doesn't show up on the page. If I replace the code to add the video control with a label the label works just fine, so I think it has something to do with the fact it is a user control. I tried LoadControl but it needs the ascx file location(which I don't have) and not the dll.

Here is a sample of the code I'm running.

TableCell cell = new TableCell();
ASPNetVideo.WindowsMedia media1 = new ASPNetVideo.WindowsMedia();
media1.VideoURL = "source loc";
cell.Controls.Add(media1);

Thanks.
Dave
Posted: Saturday, November 14, 2009 12:00:58 AM
Rank: Administration
Groups: Administration

Joined: 7/20/2007
Posts: 302
Points: -2,494
Location: Primarily in New York, USA
campbke,

Unfortunately we've been unable to get that behavior to properly work in our controls due to some of our advanced functionality. Essentially, a copy of one of our controls needs to be in the web markup for it to work. You can modify it from the code behind, but you cannot *Add* it to the page from the code behind.

If you can give me more details about what you're looking to build out, I can help you design your code so that it works with our controls.

Thanks.

-Dave
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.