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

Programmatically adding control Options · View
NextGenAviator
Posted: Friday, April 09, 2010 4:18:14 PM
Rank: Newbie
Groups: Member

Joined: 4/9/2010
Posts: 1
Points: 3
I'm trying to do this:

ASPNetVideo.WindowsMedia VideoMediaPlayer1 = new WindowsMedia();
VideoMediaPlayer1.MaintainAspectRatio = true;

VS2008 tells me that "ASPNetVideo.WindowsMedia' does not contain a definition for 'MaintainAspectRatio' and no extension method 'MaintainAspectRatio' accepting a first argument of type 'ASPNetVideo.WindowsMedia' could be found".

Also, when I try to add VideoMediaPlayer1 to a Placeholder, like so:

VideoPlaceholder.Controls.Add(VideoMediaPlayer1);

I get "cannot convert from 'ASPNetVideo.WindowsMedia' to 'System.Web.UI.Control'".

It would be very helpful if you provided real documentation for these controls. You know, the kind that shows the namespaces, inheritance hierarchy, properties/methods, etc. How am I supposed to know what ASPNetVideo.WindowsMedia inherits from if it's not a UI.Control? And how are you supposed to add these controls programmatically? Your sample code examples has zero examples - they are all declarative through the ASPX file, none with examples using code-behind.

Any help appreciated; I'm trying to get a project finished and switched to your controls because they seemed the best. But I'm stuck now.

Dave
Posted: Friday, April 16, 2010 6:35:44 AM
Rank: Administration
Groups: Administration

Joined: 7/20/2007
Posts: 305
Points: -2,485
Location: Primarily in New York, USA
Unfortunately, you can't add any of our controls from the code-behind - that's your problem, and it's why we haven't documented any of that. You need to place the control in your ASPX page, and then you can reference it from code-behind, but you can't add the control to the page from code-behind.

Sorry that this isn't clearer in our documentation.

-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.